Why can't run.exe execute a shebang script directly?

Eric Blake eblake@redhat.com
Fri Oct 24 13:57:00 GMT 2014


On 10/24/2014 07:53 AM, Corinna Vinschen wrote:
> On Oct 24 06:05, John Wiersba wrote:
>> I would have thought cygwin1.dll contains the code necessary to do this, like the linux kernel does.  Can it be added to the dll or does it have to be added to each executable individually, such as bash.exe, run.exe, etc.?
>>
>>   bash$ /bin/run ./try
>>   run FATAL: Could not start D:\ftp\try
> 
> run.exe doesn't start the executable via a Cygwin function, but via a
> Windows call.  There's no chance for the DLL to handle shebangs.

Of course, if you wanted to be nice, you could write a patch to run.exe
that teaches it to read() the contents of a file that it is about to
execute, and if it starts with a shebang, run the interpreter directly
instead of handing things off to the Windows call (and maybe make this
mode optional, requiring a command line option to turn on?).  This is
open source, after all.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 539 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20141024/c2d4900e/attachment.sig>


More information about the Cygwin mailing list