From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22651 invoked by alias); 7 Jan 2009 09:44:26 -0000 Received: (qmail 22635 invoked by uid 22791); 7 Jan 2009 09:44:25 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_73 X-Spam-Check-By: sourceware.org Received: from mtaout02-winn.ispmail.ntl.com (HELO mtaout02-winn.ispmail.ntl.com) (81.103.221.48) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Jan 2009 09:44:19 +0000 Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090107094412.QBFH4080.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com>; Wed, 7 Jan 2009 09:44:12 +0000 Received: from cog.dallaway.org.uk ([213.106.92.119]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090107094412.JKGQ2093.aamtaout03-winn.ispmail.ntl.com@cog.dallaway.org.uk>; Wed, 7 Jan 2009 09:44:12 +0000 Received: from cog.dallaway.org.uk (cog.dallaway.org.uk [127.0.0.1]) by cog.dallaway.org.uk (8.13.8/8.13.8) with ESMTP id n079i9OP003556; Wed, 7 Jan 2009 09:44:09 GMT Message-ID: <49647969.5060206@dallaway.org.uk> Date: Wed, 07 Jan 2009 09:44:00 -0000 From: John Dallaway User-Agent: Thunderbird 2.0.0.18 (X11/20081120) MIME-Version: 1.0 To: Jonathan Larmour , Gary Thomas CC: ecos-devel@ecos.sourceware.org Subject: Re: #! magic for finding Cygwin Tcl shell References: <49639C9C.9040607@dallaway.org.uk> <4963A830.6090600@eCosCentric.com> <4963AC97.4070405@mlbassoc.com> <4963B47A.8040400@eCosCentric.com> In-Reply-To: <4963B47A.8040400@eCosCentric.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2009-01/txt/msg00012.txt.bz2 Jonathan Larmour wrote: > Gary Thomas wrote: >> Jonathan Larmour wrote: >>> John Dallaway wrote: >>>> Rather than increase the complexity of the #! magic still further, I >>>> think it now makes sense to revert to a simple "#! /usr/bin/tclsh" >>>> within our Tcl scripts. However, this would break compatibility with old >>>> Cygwin installations providing only tclsh8*.exe or cygtclsh80.exe. >>>> >>>> Any objections? >>> Yes, it may not be in /usr/bin. I don't mind the cygwin-specific cygpath >>> bits being dropped, but I'd still want it to be found from the PATH by some >>> means. >> Does CygWin have '/usr/bin/env'? This is the "modern" way >> to handle this: >> >> #! /usr/bin/env tclsh >> ... > > I'd forgotten about that because I'm a bit wary of it in general as you > can't pass arguments to it, e.g. this doesn't work as you'd expect: > #! /usr/bin/env echo "$@" > > But that problem probably doesn't apply to most if not all our cases - the > arguments are passed as-is, so yes this should probably work. "#! /usr/bin/env tclsh" will work for modern Cygwin, but are we able to guarantee the availability and location of "env" any more than that of "tclsh" for some arbitrary UNIX-like OS? There has been no objection to dropping support for tclsh83 and cygtclsh80 so, for the time being, I will take the robust and minimally invasive approach of tweaking the CDL make rule to call "tclsh heapgen.tcl ..." directly. Clearly we don't need the convenience of #! magic in this particular context. John Dallaway