Shell scripts starting with "#"

Scott Blachowicz scott at grlab.UUCP
Thu Oct 18 02:29:19 AEST 1990


>    [Moderators Note:-
>    To save a deluge of mail and postings, the answer is to
>    put a ':' by itself on line one of the script.  For example;
>    :
>    # This is the second line of a bourne-shell script.
>    This may not work on absolutely *every* variant, but it should cover most.
> 						   - Der]
But the ":" doesn't work on systems that support "#!". My latest
solution (having recently been forced to work with a "straight"...read
archaic/restrictive... System V system) looks like this:
   #!/bin/sh
   : || exec /bin/sh $0 $argv:q

Regarding Re: Shell scripts starting with "#"; pd at x.co.uk (Paul Davey) writes:
> ...
> Machines that don't recognise #! seem to be fairly rare now though.

Don't know about that...doesn't SCO have a few customers?
--
Scott Blachowicz                E-mail:  scott%grlab.UUCP at hpubvwa.HP.COM
USPS:  Graphicus                 ..or..  ...!hpubvwa!grlab!scott
       150 Lake Str S, #206     VoicePh: 206/828-4691
       Kirkland, WA USA 98033   FAX:     206/828-4236



More information about the Comp.unix mailing list