[TAG] Re: Subversion email

Ben Okopnik ben at callahans.org
Fri Feb 13 02:01:56 MSK 2004


On Thu, Feb 12, 2004 at 11:56:35AM -0800, Mike Orr wrote:
> 
> The problem isn't with env, it's shbang.  For some reason in Unix
> antiquity, they never considered that you might need more than one
> argument.  

I've read that there are some OSes out there that only take one; there
are also some that stop kernel interpretation after a maximum of 32
characters. "bash" under Linux doesn't seem to be one of them, though.

``
#!/usr/bin/perl -w -w -w -w -w -w -w -w -w -w -w -w -w -w -w -n
print
''

ben at Fenrir:/tmp$ ./foo foo
#!/usr/bin/perl -w -w -w -w -w -w -w -w -w -w -w -w -w -w -w -n
print

If the "-n" switch hadn't been read, this would have failed. Seems to
me that "env" is to blame.

> They probably also never thought you might want to use 'env'
> in a shbang line to get around the fact that shbang doesn't do path
> lookup.

Well, there's *some* sort of a mechanism that allows you to split the
shebang (in some odd contorted way) to the following lines; I've seen it
used with "wish", and Perl has its own version for the above weird
systems:

``
#!/bin/sh -- # -*- perl -*- -p
eval 'exec perl -wS $0 ${1+"$@"}'
    if $running_under_some_shell;
''


* Ben Okopnik * okopnik.freeshell.org * Technical Editor, Linux Gazette *
-*- See the Linux Gazette in its new home: <http://linuxgazette.net/> -*-




More information about the TAG mailing list