bash -s from .bat file

Earnie Boyd earnie_boyd@yahoo.com
Tue Jul 14 08:29:00 GMT 1998


Your stated problem on the directories can be solved like this:

  bash#> cd /
  bash#> ln -s //x/a a

now when you do `sh -s /a/b/c/foo.sh %1' it should be able to find it
because //x/a is symbolicly linked to a.



---Earl Chew <earl@hpautodb.aus.hp.com> wrote:
>
> : > 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                            
  |
>
>----------------------------------------------------------------------+
> 

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list