the #! notation
Andrew H. Marrinson
andy at xwkg.Icom.Com
Mon Jan 28 16:34:47 AEST 1991
davidsen at sixhub.UUCP (Wm E. Davidsen Jr) writes:
> It seems to me
>there's a mechanism in SysV which put a line like
> : uses /bin/csh
>as the first line, but I can't remember where I saw it.
Just to clear up a common misconception here. I know of no shell that
allows anything resembling ``: use some_program'' to specify an
arbitrary interpreter like the #! syntax does. The idea that this
works seems to have come from Larry Wall's configure script, which
checks to see if #!/bin/sh arranges for scripts to be executed by
Bourne shell, and if that fails, checks : use /bin/sh. The latter is
used because some older cshs (especially on system V and similar
Unixes that lack #!) treat scripts beginning with # as csh scripts
while scripts beginning with any other character are executed with
/bin/sh. It is the ``:'' that is significant in this case. The
phrase ``use /bin/sh'' is just a comment.
--
Andrew H. Marrinson
Icom Systems, Inc.
Wheeling, IL, USA
(andy at icom.icom.com)
More information about the Comp.unix.shell
mailing list