Date: Sat, 2 Oct 2004 16:35:42 -0700 From: "David G. Lawrence" <dg@dglawrence.com> To: Garance A Drosihn <drosih@rpi.edu> Cc: freebsd-current@freebsd.org Subject: Re: Bug in #! processing (long reply) Message-ID: <20041002233542.GL714@nexus.dglawrence.com> In-Reply-To: <p0611041fbd848f6aa55d@[128.113.24.47]> References: <200410020349.i923nG8v021675@northstar.hetzel.org> <20041002052856.GE17792@nexus.dglawrence.com> <p0611041fbd848f6aa55d@[128.113.24.47]>
next in thread | previous in thread | raw e-mail | index | archive | help
> fact, it seems to be the '--' which is causing the rest of the > line to be ignored, not the '#'. > > The PR is correct in that this feature is documented by perl books, > but the right way to support the feature is to change /bin/sh and > not the command interpreter. The PR includes a followup reply from > Ahmon Dancy <dancy@dancysoft.com> with some additional proof that > the change to the command interpreter was the wrong way to fix this. > > Since this perl feature is documented in many places (including the > famous "Camel" book from O'Reilly), we can not just drop the support > in the command interpreter. But if we first fix /bin/sh then I > believe we can drop it. Err, your terminology is a bit off (/bin/sh is the "command interpreter"); what we're talking about is the behavior of the execve() system call in the kernel, specifically the imgact_shell image activation module. When the system sees that a file needs to be interpreted by something (e.g. sh, perl, python, or some other language interpreter) it parses the interpreter line specified at the top of the file (#!/bin/sh) and sets up to invoke that with the original file as the argument. ...but I see what you're saying and I agree with the thought. The interpreter should decide if the # is a comment, not the kernel. -DG David G. Lawrence President Download Technologies, Inc. - http://www.downloadtech.com - (866) 399 8500 TeraSolutions, Inc. - http://www.terasolutions.com - (888) 346 7175 The FreeBSD Project - http://www.freebsd.org Pave the road of life with opportunities.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041002233542.GL714>