make importing SHELL

Dr. T. Andrews tanner at ki4pv.uucp
Sun Oct 2 00:08:31 AEST 1988


In article <4147 at bsu-cs.UUCP>, dhesi at bsu-cs.UUCP (Rahul Dhesi) writes:
) I think the problem is that $SHELL exists at all.  It's a poor
) substitute for the #! in 4.3BSD.

The "#!" mechanism and the $SHELL mechanism address different issues.
One is not a substitute for the other.

The first tells the exec(2) family what interpreter should be used
on a "program", since it is not executable.  This causes, eg, "csh"
scripts to be run with "csh".

The second is used by certain applications which wish to spawn a user
shell.  A common case is the "ex" family of editors, which have a "sh"
command to give you a sub-shell without losing your editing session.

Neither of these mechanisms is suitable for determining how commands
should be interepreted in a "Makefile".  It might be clever to start
a Makefile with the line "#! /bin/make SHELL=/bin/sh", and make the
Makefile executable, so that you said "Makefile" instead of "make".

The mistake of importing $SHELL for Makefiles has been made already,
so the clever writer will probably try to include a "SHELL=" line,
not because it is a good thing, but simply for safety.
-- 
...!bikini.cis.ufl.edu!ki4pv!tanner  ...!bpa!cdin-1!cdis-1!ki4pv!tanner
or...  {allegra killer gatech!uflorida decvax!ucf-cs}!ki4pv!tanner



More information about the Comp.unix.wizards mailing list