From owner-freebsd-current@FreeBSD.ORG Thu Sep 30 14:23:18 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8755B16A4CE for ; Thu, 30 Sep 2004 14:23:18 +0000 (GMT) Received: from ptcnat.era.pl (ptcnat.era.pl [213.158.197.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD69743D5C for ; Thu, 30 Sep 2004 14:23:17 +0000 (GMT) (envelope-from zaks@era.pl) Received: by localhost (Postfix, from userid 1001) id 6E97E11652; Thu, 30 Sep 2004 16:23:16 +0200 (CEST) Resent-To: freebsd-current@freebsd.org Resent-From: szak@era.pl (=?iso-8859-2?q?S=B3awek_=AFak?=) Resent-Date: Thu, 30 Sep 2004 16:23:16 +0200 Resent-Message-ID: <86mzz7x2cr.fsf@thirst.unx.era.pl> X-From-Line: nobody Thu Sep 30 15:16:22 2004 To: "David G. Lawrence" From: =?iso-8859-2?q?S=B3awek_=AFak?= 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> Date: Thu, 30 Sep 2004 15:16:21 +0200 In-Reply-To: <20040930124810.GA17792@nexus.dglawrence.com> (David G. Lawrence's message of "Thu, 30 Sep 2004 05:48:10 -0700") Message-ID: <86y8irx5ga.fsf@thirst.unx.era.pl> User-Agent: Gnus/5.110003 (No Gnus v0.3) XEmacs/21.4 (Reasonable Discussion, berkeley-unix) Lines: 37 MIME-Version: 1.0 Content-Type: text/plain; charset=undecided Content-Transfer-Encoding: 8bit cc: Ryan Sommers cc: Ceri Davies cc: freebsd-current@freebsd.org Subject: Re: Bug in #! processing X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2004 14:23:18 -0000 "David G. Lawrence" 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(1950)% cat tst.sh #!/bin/no-such-file ps -lp $$ Which generates following output. thirst(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