Forcing /bin/sh in a script under V/386 3.2 Korn shell
Michael "Ford" Ditto
ford at cbmvax.UUCP
Thu Jul 13 12:32:00 AEST 1989
In article <1989Jul12.191342.1048 at cs.dal.ca> trent at cs.dal.ca (Trent MacDougall) writes:
> if [ "$RANDOM" != "$RANDOM" ]
> then
> /bin/sh -c "$0 $*"; exit $?
> fi
>
>This will force all shell scripts to be run under sh instead of ksh.
Umm ... not quite -- sometimes ksh would still be used, at RANDOM, you
might say (anytime $RANDOM happens to return the same value both times).
The example also trashes the argument list.
--
-=] Ford [=-
"The number of Unix installations (In Real Life: Mike Ditto)
has grown to 10, with more expected." ford at kenobi.commodore.com
- The Unix Programmer's Manual, ...!ucsd!crash!kenobi!ford
2nd Edition, June, 1972. ditto at cbmvax.commodore.com
More information about the Comp.sys.att
mailing list