[comp.unix.questions] #! shells

maart@cs.vu.nl (Maarten Litmaath) (09/25/89)

guy@auspex.auspex.com (Guy Harris) writes:
\... "#!" (to handle the 3 shells - Bourne, C, and Korn - [...]

You forgot to important `shells':

	#!/bin/sed -f
	#!/bin/awk -f
:-)

Can you figure out why I don't want sed's `#n' hack to be limited to the first
line of the script only?
What I REALLY want, of course, is to get rid of that (understandable but)
stupid 32-characters-and-1-option `#!' limitation.
-- 
   creat(2) shouldn't have been create(2): |Maarten Litmaath @ VU Amsterdam:
      it shouldn't have existed at all.    |maart@cs.vu.nl, mcvax!botter!maart

guy@auspex.auspex.com (Guy Harris) (09/27/89)

>You forgot to important `shells':
>
>	#!/bin/sed -f
>	#!/bin/awk -f
>:-)

And *you* forgot

	#! /bin/make -f

:-) :-)

and, for that matter,

	#! /usr/ucb/vi
	#! /usr/local/emacs
	#! /bin/ed
	etc.

:-) :-) :-) :-) :-)

>Can you figure out why I don't want sed's `#n' hack to be limited to the first
>line of the script only?

The headache with that hack is that somebody might have a long comment
(I think the S5R4 "sed" will support "#" as a general comment character,
as BSD's "sed" already does) one of the lines of which begins with "n".

A better fix would be to teach "sed" about "getopt", so that

	#!/bin/sed -nf

works.

>What I REALLY want, of course, is to get rid of that (understandable but)
>stupid 32-characters-and-1-option `#!' limitation.

It'd be nice, but I don't know if it's coming in S5R4 - or 4.4BSD, for
that matter.