Re: /bin/sh portability question

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Peter Eriksen <s022018@...>
Cc: <git@...>
Date: Friday, September 23, 2005 - 4:24 am

"Peter Eriksen" <s022018@student.dtu.dk> writes:


Perhaps "gmake NO_STRCASESTR=YesPlease"?

Do people use glibc or other alternative C libraries on Solaris
these days?  If nobody does, and everybody on SunOS lack
strcasestr, we could make SunOS imply NO_STRCASESTR in the
Makefile.



Writing $(command) instead of `command` is not a bashism; Korn
supports it and even ash seems to.  But saying that would not
reduce the pain from non-sysadmins.

In many places we could just rewrite them to old-timer back-tick
form, unless we nest, in which case you would end up doing
something like this for readability:

	foo=$(command $(command to compute arg to it))

	arg=`command to compute arg to it`
        foo=`command "$arg"`

I haven't assessed the extent of damage if we tried to use ``
for portability lately (I did once, and it did not look too bad
back then).  If somebody comes up with a readable patch, I might
be persuaded to take it [*1*].

Another thing that will bite you is the use of shell arrays -- I
was trying to stay away from it but at least git-grep uses it
now (and hopefully nobody else).  It may not be a bad idea to
rewrite that one script in Perl or Python.


[Footnotes]

*1* Personally I feel that the only bug in Bourne was that it
did not spell command substitution as $().

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
/bin/sh portability question, Peter Eriksen, (Fri Sep 23, 3:50 am)
Re: /bin/sh portability question, H. Peter Anvin, (Fri Sep 23, 3:48 pm)
Re: /bin/sh portability question, Joel Becker, (Fri Sep 23, 3:57 pm)
Re: /bin/sh portability question, H. Peter Anvin, (Fri Sep 23, 4:00 pm)
Re: /bin/sh portability question, Morten Welinder, (Fri Sep 23, 3:55 pm)
Re: /bin/sh portability question, Junio C Hamano, (Fri Sep 23, 5:07 am)
Re: /bin/sh portability question, Patrick Mauritz, (Sat Sep 24, 1:35 pm)
Re: /bin/sh portability question, Peter Eriksen, (Fri Sep 23, 8:17 am)
Re: /bin/sh portability question, Junio C Hamano, (Fri Sep 23, 4:24 am)
Re: /bin/sh portability question, Sean, (Fri Sep 23, 5:02 am)
Re: /bin/sh portability question, Junio C Hamano, (Fri Sep 23, 5:19 am)
Re: /bin/sh portability question, Sean, (Fri Sep 23, 6:34 am)