www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/07/14/19:11:51

From: earl AT hpautodb DOT aus DOT hp DOT com (Earl Chew)
Subject: Re: bash -s from .bat file
14 Jul 1998 19:11:51 -0700 :
Message-ID: <199807141236.FAA20624.cygnus.gnu-win32@palrel1.hp.com>
References: <19980714121407 DOT 16894 DOT rocketmail AT send1d DOT yahoomail DOT com>
To: earnie_boyd AT yahoo DOT com
Cc: gnu-win32 AT cygnus DOT com, earl DOT chew AT altavista DOT net

: > I have a batch file which I wrote for b18. It basically
: > reads:
: > 
: > sh -s %1 < \a\b\c\foo.sh

I should have emphasised that this is a batch file that runs from cmd.exe.
So foo.bat contains:

sh -s %1 < \a\b\c\foo.sh

: > a. I must use bash instead of sh.
: 
: This is known, it has been suggested to:
:   #> mv sh.exe ash.exe
:   #> cp bash.exe sh.exe

Thanks for the hint.

: > b. Even after using bash, the contents of the script
: >    are not read and executed correctly. Weird things
: >    happen (eg : causes much confusion).
: > 
: 
: Well, since we don't have the contents of the script nor the `Weird
: things' that happen it's tuff for any of us to know what is going on.

Ok. I'll try to put together a small sample tomorrow.

: > Using:
: > 
: > sh //e/a/b/c/foo.sh %1
: > 
: > appears to work... but unfortunately is not drive
: > independent :-(
: 
: Have you tried `sh /a/b/c/foo.sh %1'?

Yes. That works (as expected) --- but the semantics are subtley different.

I've got a script that I want to have execute irrespective of the drive
it happens to installed on. In this instance, I have a bunch of files that are
installed in directory x:\a\b\c. The drive relative path (in Win32 terms)
is \a\b\c.

I can get to the file in Cygwin only by giving an absolute path //x/a/b/c.
Thus although sh /a/b/c/foo.sh "works" from a cmd.exe batch file --- it
cannot find the file in a drive relative way --- only \a\b\c\foo.sh can
do that.

Let me know if there's any confusion here.

So, the only way that I could think of to get hold of the shell script in
a drive relative way was to get a Win32 batch file to locate the script:

foo.bat:
	sh -s %1 < \a\b\c\foo.sh

foo.sh:
	# Rest of script

This way, I can "execute" the shell script from a Win32 command shell. Or
I could until I tried b19 :-(

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                               |
>----------------------------------------------------------------------+
-
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