Re: please fix your RC bugs
Steve Greenland <email@example.com> writes:
> On 10-Aug-05, 13:38 (CDT), Philip Brown <firstname.lastname@example.org> wrote:
>> >  Useful fragment for cross platform shell scripts:
>> > #!/bin/sh
>> > # Do the Solaris Dance:
>> > if [ ! -d ~root ] ; then
>> > exec /usr/xpg4/bin/sh $0 "$@"
>> > fi
>> sigh.. okay, my "correction" had bugs, too :-)
>> better as
>> if [ ! -d ~root -a -x /usr/xpg4/bin/sh ] ; then
> No, because that will let the script continue if there is no POSIX shell
> available. You want it to exit immediately, rather than randomly fail
> when you hit unsupported functionality.
> As a practical matter, any modern Solaris (>=7, probably even 2.6 and 2.5)
> machine has /usr/xpg4/bin/sh installed.
But what if there is a /usr/xpg4/bin/sh that isn't posix? :)