Subject: Re: How to make a shell script runnable?
From: [email-masked] (Michael Mauch)

5 Sep 1998 02:19:19 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
To: gnu-win32 <[email-masked]>

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
flag.

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".

Regards...
		Michael
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".