1

Following this post I wasn't able run shell trough Git bash. This is the batch file :

%ComSpec% /c ""C:\Program Files\Git\git-bash.exe" --login -i -- C:\Users\rmrd001\Documents\Git\scripts\first\test.sh"
pause

This is the shell script:

echo Hello, World!

And this is what I get when batch is run:

enter image description here

I can see the instantaneous appearance of the bash program, but can't catch the text into it. I double-triple-checked the paths, they are correct. I ran the script trough the Git bash, everything worked well (the message appeared).

Any ideas?

Community
  • 1
  • 1
Hairi
  • 3,318
  • 2
  • 29
  • 68

1 Answers1

1

I have seen a different syntax before.

I only see the message with:

start "" git-bash.exe -i -l -c "/C/path/to/script.sh"

With script.sh including a pause:

echo Hello. World!
read -n1 -r -p "Press any key to continue..." key

The OP Hairi report in the comments making it work with:

start /b cmd /c "C:/Program Files/Git/git-bash.exe" /C/path/to/script.sh
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • This worked to me: start /b cmd /c "C:/Program Files/Git/git-bash.exe" /C/Users/rmrd001/Documents/Git/scripts/first/test.sh – Hairi Aug 29 '16 at 09:19
  • @Hairi Great! I have included your comment in the answer for more visibility. – VonC Aug 29 '16 at 09:24