Call Batch Script from Shell Script using Git Bash

Rog Matthews

I have a batch script(master.bat) which calls a host of batch scripts. Master.bat:

call a.bat
call b.bat
call c.bat

The shell script(call_master.sh) that calls this batch script is:

echo $PATH
cmd /c master.bat

I am invoking this shell script on Windows-7 using Git Bash. When i run the shell script I don't get any errors but None of the scripts is getting invoked by master.bat. What should be done to to do this correctly

codess

It might help to double the slash in the /c switch so it is not interpreted as the C: drive by the shell.

I made a little test, and this was the command and output:

$ cmd //c master.bat

> call a.bat

> echo hello from a
hello from a

> call b.bat

> echo hello from b
hello from b

> call c.bat

> echo hello from c
hello from c

Here's another reference from the Mingw wiki about path conversion.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related