delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/01/19/16:15:51

From: dbe AT wgn DOT net ($Bill Luebkert)
Subject: Re: mysterious bash problem
19 Jan 1998 16:15:51 -0800 :
Message-ID: <34C1A5E5.698FC665.cygnus.gnu-win32@wgn.net>
References: <19980114131619 DOT 11340 DOT qmail AT hotmail DOT com>
Mime-Version: 1.0
To: Earnie Boyd <earnie_boyd AT hotmail DOT com>
Cc: Ulrich DOT Lauther AT mchp DOT siemens DOT de, gnu-win32 AT cygnus DOT com

Earnie Boyd wrote:
> 
> It might help to see foo.  UNIX shell scripts must begin with #!
> /path/to/shelltoexecute. 

Not true!

>                           If you were on UNIX you would then have to set
> the executable bit on the file properties/permissions.  

Depends on how you initiate the script.  True if you execute by using 
the script name (eg: "foo.sh" for the script foo.sh).  You could also 
source the script or use it as an argument to the shell.

>                                                         The cygwin.dll
> layer tries to mimick as much of UNIX as it can.  Since the file doesn't
> begin with #! you will not see the executable bit set on the permissions
> as that is how it determines if the file is executable.
> 
> I have noticed that the gnu-win32 bash will try to execute the script
> even without the #! indicator.  This is a bug as bash should error
> without this indicator.  For more information see the bash.info file.

Correct behavior, since the shebang line is not required.

-- 
  ,-/-  __      _  _         $Bill Luebkert
 (_/   /  )    // //       DBE Collectibles
  / ) /--<  o // //      http://www.wgn.net/~dbe/
-/-' /___/_<_</_</_    Mailto:dbe AT wgn DOT net
-
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