(unknown charset) Re: Bug in #! processing

From: (unknown charset) Sławek Żak <zaks_at_prioris.mini.pw.edu.pl>
Date: Thu, 30 Sep 2004 15:16:21 +0200
"David G. Lawrence" <dg_at_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
Received on Thu Sep 30 2004 - 12:23:18 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:14 UTC