Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sed command not found when run shell in window git bash

Tags:

git

shell

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

like image 446
David Avatar asked Dec 29 '25 12:12

David


1 Answers

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.

like image 88
VonC Avatar answered Jan 01 '26 03:01

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!