delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/09/28/16:58:34

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <39D3B161.C49B2F93@openmarket.com>
Date: Thu, 28 Sep 2000 17:00:17 -0400
From: "Guy T. Moore Jr." <gmoore AT openmarket DOT com>
Organization: Engineering
X-Mailer: Mozilla 4.73 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT sourceware DOT cygnus DOT com
CC: perakis AT openmarket DOT com, wabraham AT openmarket DOT com
Subject: Can't exec /bin/sh.exe at ./dog.sh line 1.
References: <39D373A8 DOT 1AF731C0 AT openmarket DOT com>

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 AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019