David
David

Reputation: 959

sed command not found when run shell in window git bash

I write shell in .sh file and run it in git bash of windows platform. The Git bash command line, it shows "sed command not found", but when i type sed command in the git bash command line, it could display the sed help information and if i run the .sh's sed clause, it executed properly. I don't know why

Upvotes: 3

Views: 7703

Answers (1)

VonC
VonC

Reputation: 1324537

Make sure where the 'sed' is found when executed directly in the shell:

which sed

Then echo the path in your script (meaning: add the following line in your script, and run said script):

echo $PATH

And see if the script, when executed, include a PATH which has the folder where sed is found.
If not, modify the PATH in your script, or use the full path of the sed command in your script.

Upvotes: 2

Related Questions