Steve Greenland <[EMAIL PROTECTED]> writes:

> On 10-Aug-05, 13:38 (CDT), Philip Brown <[EMAIL PROTECTED]> wrote: 
>> > [1] 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.
>
> Steve

But what if there is a /usr/xpg4/bin/sh that isn't posix? :)

MfG
        Goswin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to