This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bash -s from .bat file


: > 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@hp.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@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]