This is the mail archive of the
ecos-devel@sourceware.org
mailing list for the eCos project.
Re: #! magic for finding Cygwin Tcl shell
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