delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/09/05/02:19:19

From: michael DOT mauch AT gmx DOT de (Michael Mauch)
Subject: Re: How to make a shell script runnable?
5 Sep 1998 02:19:19 -0700 :
Message-ID: <199809031730.TAA28665.cygnus.gnu-win32@crimson.ihg.uni-duisburg.de>
References: <50E89D0739DBD1119B5500A0C932C7E621593A AT exchsrv DOT ubisoft DOT com DOT cn>
Mime-Version: 1.0
To: gnu-win32 <gnu-win32 AT cygnus DOT com>

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
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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