Reputation: 934
I am trying to run a sh file on git bash on Windows 10. I am even seeing the statements which I don't want to be shown like variable assignment in the console. But the same stuff I can't see on either Windows Subsystem for Linux(WSL) or other linux distributions. It becomes a bit annoying to see all the code lines in the sh file when trying to run that, when I am only interested in seeing the statements which I want to echo. Can someone please help in this ?
Sample sh file :
#!/usr/bin/env sh
VARIABLE="OK"
echo $VARIABLE
Output on git bash:
Output on WSL(or any other Linux Systems):
Upvotes: 1
Views: 204
Reputation: 1
That only happens when both of these occur:
set -x
is usedPS4
is setIf you fix either one, the messages will go away.
If you want to fix number one, you can do set +x
, or you can find the file that
is calling set -x
and remove that line. Probably ~/.bash_profile
or
~/.bashrc
.
If you want to fix number two, you can do PS4=
, and you can add it to one of
those files above to persist if you want.
Upvotes: 1