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

-- 
Steve Greenland
    The irony is that Bill Gates claims to be making a stable operating
    system and Linus Torvalds claims to be trying to take over the
    world.       -- seen on the net


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

Reply via email to