delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/09/01/11:44:59

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Fri, 1 Sep 2000 19:20:30 +0400
From: Egor Duda <deo AT logos-m DOT ru>
X-Mailer: The Bat! (v1.45) Personal
Reply-To: Egor Duda <cygwin AT sources DOT redhat DOT com>
Organization: DEO
X-Priority: 3 (Normal)
Message-ID: <27369117122.20000901192030@logos-m.ru>
To: Cygwin <cygwin AT sources DOT redhat DOT com>, mike AT blueoaksoftware DOT com
Subject: Re: Fwd: UPDATE: Newbie bash user problem--interactive bash will not run my scripts!
In-reply-To: <20000901110536.L1104@DP>
References: <20000901110536 DOT L1104 AT DP>
Mime-Version: 1.0

Hi!

Friday, 01 September, 2000 Jason Tishler Jason DOT Tishler AT dothill DOT com wrote:

>> Still  no  luck  on  working,  but  I  have run some tests and have
>> cygcheck diagnostics. BTW, I *do* have '.' (and also tried './') on
>> my path in various places.
>> 
>> Here is the one-line (or two) shell script (test.sh) that I'm using as a
>> test:
>> 
>>     echo "We did it!"
>> 
>> Here is the output calling this script (and me typing a comment before each
>> invocation):
>> 
>> /cygdrive/c/Work/gc/distrib 320%># Only the one line shown in the script:
>> /cygdrive/c/Work/gc/distrib 321%>test.sh
>> BASH.EXE: ./test.sh: No such file or directory
>> /cygdrive/c/Work/gc/distrib 322%># I've now added #!/bin/sh as first line to
>> sc
>> ript:
>> /cygdrive/c/Work/gc/distrib 323%>test.sh
>> We did it!
>> /cygdrive/c/Work/gc/distrib 324%># I've now added #!/bin/bash as first line
>> to
>> script:
>> /cygdrive/c/Work/gc/distrib 325%>test.sh
>> We did it!
>> /cygdrive/c/Work/gc/distrib 326%>

the  reason  is simple. bash starts only files that have permission to
execute. you can check file permissions by typing

% ls -la test.sh

you're  running  w98,  and thus have no ntsec features (ntsec emulates
unix  permissions  by native ones). when running without ntsec, cygwin
does  a  little  trick to determine which files should have executable
bit  in their permissions -- it set this bit only for files with .exe,
.cmd and .bat extensions and those which starts with magic symbols #!

note that if you try to start your script like that

% bash -c test.sh

it will work in all 3 cases, since for '-c' parameter bash won't check
permissions

Egor.            mailto:deo AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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