From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Guy T. Moore Jr." To: cygwin@sourceware.cygnus.com Cc: perakis@openmarket.com, wabraham@openmarket.com Subject: Can't exec /bin/sh.exe at ./dog.sh line 1. Date: Thu, 28 Sep 2000 13:57:00 -0000 Message-id: <39D3B161.C49B2F93@openmarket.com> References: <39D373A8.1AF731C0@openmarket.com> X-SW-Source: 2000-09/msg00964.html Thanks for all the replies. None solved it. Let me cut to the chase with the problem that more resembles my problem: Using Cygwin 1.1.4. I'm on C: drive, an NTFS partition. CYGWIN is set to "binmode ntea" I do not have McAfee anti-virus software running. my machine has been rebooted and am in a fresh window. This is my script called dog.sh and has been chmod to 777. #!/bin/sh.exe # echo "Hello" echo $0 eval "exec perl -S $0 " <------- problem line if $avariablenotdefined; print "GoodBye"; When I execute this script, I get an error: $ c:/dog.sh Hello c:/dog.sh Can't exec /bin/sh.exe at ./dog.sh line 1. Why is Cygwin exec'ing /bin/sh.exe when it should be exec'ing perl? And why can't Cygwin exec /bin/sh.exe anyways? If I remove the #!bin/sh.exe from the script, I then get a different error cause Cygwin cannot determine that this file is executable: $ c:/dog.sh bash: c:/dog.sh: No such file or directory. Hence my first problem, I emailed about. Help! "Guy T. Moore Jr." wrote: > > 1.) > Seems like I should be able to do the following simple shell scripting: > > I'm in a Cygwin 1.1.4 window at my C: prompt. > > I create a file, called myscript, with the 1 line of: > > echo "doggie" > > I cannot execute this successfully: > > $ ./myscript > bash: ./myscript: No such file or directory. > > I can execute myscript succesfully if I add at the top of the > myscript the line of: > > #!/bin/sh > > and I can also execute myscript succesfully if I, preface the command with /bin/sh: > > $ /bin/sh myscript > > I'd rather get it to work the way it does on Solaris 5.7 in a bourne shell or csh > without using any work arounds. > > This problem is preventing other simple things from working correctly. > > 2.) > I have the environment variable "TMP" defined as both a SYSTEM and USER environment > variable, but when I open up a Cygwin window it does not have this set. > It has all the other ones set, why did it unset this? > > Guy Moore > OpenMarket -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe@sourceware.cygnus.com