This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Possible bug in exec with symlink.
- To: cygwin at cygwin dot com
- Subject: Possible bug in exec with symlink.
- From: Mo DeJong <mdejong at cygnus dot com>
- Date: Tue, 5 Dec 2000 16:03:44 -0800 (PST)
Hi all.
I think I have run into a bug in the way Cygwin
deals with symlinks in an exec. I am using the
most recent net release on an NT box.
First, the simple case that works correctly.
$ cat one.sh
#!/bin/sh
echo one.sh running
sleep 5
exit 0
$ ./one.sh
one.sh running
$ ln -s one.sh two.sh
$ ./two.sh
one.sh running
# An now the bit that does not work.
This script uses the #! like so:
$ head fake_toolchain
#! /home/mdejong/install/SN452/bin/itcl_sh
# This is a faked up compiler that can
# be used to test the GUI toolchain
Note that it runs just fine from the
cmd line.
$ ./fake_toolchain
fake_toolcahin script
But, a symlink to it does not work.
$ ln -s fake_toolchain mygcc
$ ./mygcc
invalid command name "!<symlink>fake_toolchain "
while executing
"!<symlink>fake_toolchain "
(file "./mygcc" line 1)
It looks like Cygwin is getting confused about which
file it should pass to the program. It is looking for
the #! in the symlink but when it gets run, it passes
the name of the symlink on the cmd line.
./itcl_sh.exe mygcc
nvalid command name "!<symlink>fake_toolchain "
while executing
!<symlink>fake_toolchain "
(file "mygcc" line 1)
cheers
Mo DeJong
Red Hat Inc
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com