Forcing /bin/sh in a script under V/386 3.2 Korn shell

Trent MacDougall trent at cs.dal.ca
Thu Jul 13 05:13:42 AEST 1989


>From article <14445 at bfmny0.UUCP>, by tneff at bfmny0.UUCP (Tom Neff):
> I use Korn shell and am happy with it, but I want certain shell
> scripts to be intepreted by the Bourne shell instead.  There is
> already a mechanism by which CSH(1) figures out to spawn /bin/sh
> on a script rather than interpreting itself, namely putting a
> colon ':' as the first line.
> 
> What I want to know is, is there any way to do this under K-shell?
> 

I was just going to send Todd Day this note. His postings about setting
up C News helped me and I wanted to return the favor.  I put the following
at the beginning of the file /usr/local/lib/news/bin/config.

	if [ "$RANDOM" != "$RANDOM" ]
	then
		/bin/sh -c "$0 $*"; exit $?
	fi

This will force all shell scripts to be run under sh instead of ksh.
-- 
//_//_//_//_//  Trent MacDougall @ Dalhousie University, CS Dept.
\\_\\_\\_\\_\\  UUCP               {uunet watmath}!dalcs!trent
// // // // //  INTERNET           trent at cs.dal.ca



More information about the Comp.sys.att mailing list