From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1242 invoked by alias); 13 Feb 2002 14:26:02 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Received: (qmail 953 invoked from network); 13 Feb 2002 14:25:54 -0000 Received: from unknown (HELO alageremail1.agere.com) (192.19.192.106) by sources.redhat.com with SMTP; 13 Feb 2002 14:25:54 -0000 Received: from rderelay.agere.com (rderelay.agere.com [135.15.172.48]) by alageremail1.agere.com (8.10.2+Sun/8.10.2) with ESMTP id g1DEOBG23606; Wed, 13 Feb 2002 09:24:11 -0500 (EST) Received: from almail.agere.com by rderelay.agere.com (8.9.3+Sun/EMS-1.5 sol2) id JAA00561 for ; Wed, 13 Feb 2002 09:25:51 -0500 (EST) Received: from PAI820G1006951 by almail.agere.com (8.9.3+Sun/EMS-1.5 sol2) id JAA28682; Wed, 13 Feb 2002 09:25:45 -0500 (EST) From: "Gerald S. Williams" To: Cc: "David Gluss" , "Peter J. Acklam" Subject: RE: /usr/bin/env - Incorrect parsing of #! line? Date: Wed, 13 Feb 2002 06:26:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal In-Reply-To: <00b901c1b43b$ea06d130$6600a8c0@cherry> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-SW-Source: 2002-02/txt/msg00652.txt.bz2 I think DG's and PJA's original assessment was correct and BASH should be modified. Support for cross-platform scripts is important, and the #!/bin/env trick is used frequently. It is also not limited to env--any time you use multiple arguments to #! you get into trouble. For example, the following fails: #!/bin/python -tt -x print "hello, world" To avoid this, the scripting program would have to take special measures to split arguments containing spaces into multiple arguments. Perl does this, but defeating the shell's argument parser like this has got to be dangerous and no doubt involves some degree of magic. And as we've seen, that still doesn't help if you're using env to find perl. Solaris (System V) systems don't combine #! arguments that way. I don't currently have access to any, but from what I can recall, I'm pretty sure that SunOS (BSD) and the various flavors of HP and VAX UNIXes all work like Solaris in this regard. Ironically, this difference affects portability between Linux/Cygwin and traditional UNIX systems, but doesn't affect Windoze compatibility since only the extensions matter there and #! is ignored. I have also seen examples in popular Unix books (such as the O'Reilly nutshell books) that rely on multiple arguments. -Jerry -O Gerald S. Williams, 22Y-103GA : mailto:gsw@agere.com O- -O AGERE SYSTEMS, 555 UNION BLVD : office:610-712-8661 O- -O ALLENTOWN, PA, USA 18109-3286 : mobile:908-672-7592 O- Christopher Faylor wrote: > > I think you're misinterpreting the problem. If it works the same way > > on linux and on cygwin, then there is nothing to fix. David Gluss wrote: > Hmm. You're right about that. In that case I will do nothing. > Of course I've always objected to that behavior...but so it is. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/