Subject: Can't exec /bin/sh.exe at ./dog.sh line 1.
From: "Guy T. Moore Jr." <[email-masked]>
To: [email-masked]
Cc: [email-masked], [email-masked]
Date: Thu, 28 Sep 2000 17:00:17 -0400

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 [email-masked]