How to make a shell script runnable?
Fri Sep 4 03:17:00 GMT 1998
Hi Wei Xiang,
on Wed, 2 Sep 1998 09:44:01 +0800 , you wrote:
> I am using B19 in Windows 98 platform. But I can not use the chmod command
> to change a file's attributes. Why? Your suggestion will be very helpful
> to me.
DOS/Windows file systems don't have "executable" attributes, and so
Cygnus/bash has to guess whether a file is executable or not.
`chmodÃÂ´ doesn't set some magic (hidden in a file or so) executable
attribute, it can only be used to set the "writable" bits ("not
read-only" in DOS terms).
Bash executes everything, whether it shows up as "executable" in `ls -lÃÂ´
or not. It knows about popular file extensions like .exe or .com (not
.bat, maybe some others, I don't know). And bash also knows about the
so-called she-bang syntax: if you put a #! in the first line and first
column of your script, bash will call the interpreter denoted after the
"#!" (e.g. you could use "#!/bin/sh" or "#!/bin/perl"). For files with
that "#!" in the first two bytes, `ls -lÃÂ´ will display the executable
Note that on Unix (and therefore Cygnus), the search PATH for
executables doesn't include the current directory automatically, like on
DOS. So if you want to run a program "a" in the current directory, you
have to explicitly say "./a", not just "a".
For help on using this list (especially unsubscribing), send a message to
"firstname.lastname@example.org" with one line of text: "help".
More information about the Cygwin