Path: utzoo!attcan!uunet!cbmvax!ford From: ford@cbmvax.UUCP (Michael "Ford" Ditto) Newsgroups: comp.sys.att Subject: Re: Forcing /bin/sh in a script under V/386 3.2 Korn shell Summary: using $RANDOM gives RANDOM results Keywords: ksh Message-ID: <7291@cbmvax.UUCP> Date: 13 Jul 89 02:32:00 GMT References: <14445@bfmny0.UUCP> <1989Jul12.191342.1048@cs.dal.ca> Reply-To: ford@cbmvax.UUCP (Michael "Ford" Ditto) Organization: Commodore Technology, West Chester, PA Lines: 19 In article <1989Jul12.191342.1048@cs.dal.ca> trent@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@kenobi.commodore.com - The Unix Programmer's Manual, ...!ucsd!crash!kenobi!ford 2nd Edition, June, 1972. ditto@cbmvax.commodore.com