delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/07/17/07:50:39

From: lhall AT rfk DOT com (Larry Hall)
Subject: Re: bash -s from .bat file
17 Jul 1998 07:50:39 -0700 :
Message-ID: <3.0.5.32.19980716151304.00988360.cygnus.gnu-win32@pop.ma.ultranet.com>
References: <35AD4504 DOT FC683910 AT hp DOT com>
Mime-Version: 1.0
To: earl AT hpato DOT aus DOT hp DOT com, earnie_boyd AT yahoo DOT com
Cc: gnu-win32 AT cygnus DOT com

At 10:10 AM 7/16/98 +1000, Earl Chew wrote:
>Earnie Boyd wrote:
>> > This is probably true (I haven't tried it yet), but doesn't really
>> > answer the question why foo.bat containing
>> >
>> > sh -s %1 < \a\b\c\foo.sh
>> >
>> > run from a Win32 command shell doesn't work on b19.
>> >
>> 
>> It is most likely because sh which is a port of linuxes ash ends up
>> trying to open abcfoo.sh instead of \\a\\b\\c\\foo.sh.
>
>Sorry, I meant to write:
>
>bash -s %1 < \a\b\c\foo.sh
>
>I can understand reasons why ash doesn't work --- but I would
>have thought that bash would be ok.
>
>I've done some more experimenting. Here is a small shell script,
>c:\foo.sh:
>
>: bar=1
>echo Hello
>
>I type:
>
>C:\>bash -s < \foo.sh
>Hello
>: command not found
>
>C:\>C:\tmp>bash \foo.sh
>Hello
>
>It turns out that I get the same behaviour if I move this to e:\foo.sh
>and on e: drive type:
>
>E:\vob>bash -s < \foo.sh
>Hello
>: command not found
>
>E:\vob>bash \foo.sh
>\foo.sh: \foo.sh: No such file or directory
>
>Note that bash is unable to find foo.sh using the drive relative Win32
>path name.
>
>Earl
>-- 
>>----------------------------------------------------------------------+
>> Earl Chew                              mailto:earl_chew AT hp DOT com       |
>> Hewlett-Packard Australia              Tel:   +61 3 9210 5528        |
>> Advanced Networks Division             Fax:   +61 3 9210 5550        |
>> 347 Burwood Highway                    GPS:   37 51'46"S 145 10'03"E |
>> Burwood East, Victoria 3151, Australia                               |
>>----------------------------------------------------------------------+

You have something set improperly because all this works for me fine:

E:\>cat foo.sh

: bar=1
echo Hello


E:\>bash -s <\foo.sh
Hello

E:\>bash \foo.sh
Hello

What versions are you running for Cygwin and bash?  I'm running Cygwin b19.1
with something close to Sergey's version.  bash is 2.01.1.  I'm also using
binary mounts on NT (4.0 + sp3).  


Larry Hall                              lhall AT rfk DOT com
RFK Partners, Inc.                      (781) 239-1053
8 Grove Street                          (781) 239-1655 - FAX
Wellesley, MA  02181                    http://www.rfk.com
-
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