Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Sep 2004 15:16:21 +0200
From:      =?iso-8859-2?q?S=B3awek_=AFak?= <szak@era.pl>
To:        "David G. Lawrence" <dg@dglawrence.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Bug in #! processing
Message-ID:  <86y8irx5ga.fsf@thirst.unx.era.pl>
In-Reply-To: <20040930124810.GA17792@nexus.dglawrence.com> (David G. Lawrence's message of "Thu, 30 Sep 2004 05:48:10 -0700")
References:  <861xgm5ltz.fsf@thirst.unx.era.pl> <20040928194853.GT2493@submonkey.net> <86k6ud2t6t.fsf@thirst.unx.era.pl> <20040929131136.GA2493@submonkey.net> <415AB9BF.1070003@gamersimpact.com> <86is9wx8qp.fsf@thirst.unx.era.pl> <20040930124810.GA17792@nexus.dglawrence.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"David G. Lawrence" <dg@dglawrence.com> writes:

>>     What circular reference? Could you elaborate? The algorithm goes like this:
>> 
>>     1. skip all space till #!
>
>    The #! is required to be in the first two bytes of the file, so there
> can't be any spaces before it.

    Oh. Thus in following script:

thirst<zaks>(1950)% cat tst.sh
    #!/bin/no-such-file
ps -lp $$

    Which generates following output.
    
thirst<zaks>(1949)% ./tst.sh                                                                                 /tmp
  UID   PID  PPID CPU PRI NI   VSZ  RSS MWCHAN STAT  TT       TIME COMMAND
 1001 31645 31278   0   8  0  1636 1024 wait   S+    p5    0:00.00 sh ./tst.sh

    the interpreter is assumed to be /bin/sh. That's fine with me.

> I wrote the code you guys are talking about, although I had nothing to do
> with the commit in rev 1.21. I don't have an opinion on that other than
> it's been this way in FreeBSD for a long time and I share Ceri's concern
> that changing it will affect some people.

    By no means I wish to force anyone to fix their scripts for 5.3
    release. Period. I would only like to use Allegro CL in scripts, which
    unfortunately considers -#! valid in argument list and acts accordingly on
    all platforms besides FreeBSD. Some (in)compatibility shim would be
    great. Please! :)

/S    
-- 
Sławek Żak : UNIX Systems Administrator : PTC Sp. zoo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86y8irx5ga.fsf>