Executing a script with a specific shell.

Conor P. Cahill cpcahil at virtech.uucp
Sat Jan 6 10:11:35 AEST 1990


In article <458 at everex.UUCP>, jde at everex.UUCP (-Jeff Ellis) writes:
> In article <1989Dec30.122215.2199 at virtech.uucp> cpcahil at virtech.uucp (Conor P. Cahill) writes:
> >Place a:
> >	#!/bin/sh
> >as the first line of the shell file.  This always works under BSD unix and
> >if your primary shell is the csh it will work under system V.
> 
> Well is the AT&T SYSV.3.2 systems I have tried that will NOT work.
> As per the manual it says that when using csh if the first char in the first
> line of a script file is a "#" then csh thinks it will be a csh script.

I'm not sure about ESIX, but it sounds like there is a bug there.  In 386/ix
the csh will interpret the #! correctly.

The following shell will produce the indicated output:

	% cat t.sh
	#!/bin/echo hello
	VAR=test
	echo $VAR
	% t.sh
	hello t.sh
	%

So /bin/echo was run with hello and the name of the shell as arguments.
-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.unix.questions mailing list