This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bash: ./myscript: No such file or directory. TMP variable is being unset


Guy,

The fact that some shells fall back to treating files with execute 
permissions and no '#!' line as being suitable for execution by the 
standard system shell is really an artifact of a time long past. I humbly 
submit that you ought to use #! lines in all your "executable" scripts, 
even if they do operate in the way you intend on a bona fide Unix or Linux 
system.

You may have noticed that the synthesized execute permissions under Cygwin 
are keyed off of select file name extensions or the presence of '#!' as the 
first two characters of a file. I'd say Cygwin is bending over backward to 
create this degree of compatibility with Unix (-like) systems. There is 
little alternative since Windows file systems are impoverished as to 
explicit type information and access control attributes (as a Mac user and 
programmer I see file name suffixes as a very poor substitute for file type 
information).

Lastly, a quick (not thorough) check of the options and man page for BASH 
didn't reveal a way to enable the behavior you desire. Perhaps you could 
add such an option.

Randall Schulz
Teknowledge Corp.
Palo Alto, CA USA


At 09:36 AM 09/28/2000 , 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.
>
>Guy Moore


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]