I am getting this at the moment when using git bash:
C:\>bash -c pwd
C:\Program Files\Git\bin\bash.exe: line 1: $'MZ\220\003': command not found
/c
When I use the debbuging option, I get this:
C:\>bash -x -c pwd
+ $'MZ\220\003'
C:\Program Files\Git\bin\bash.exe: line 1: $'MZ\220\003': command not found
+ pwd
/c
What is causing this additional $'MZ\220\003'
command to be executed?
This is my scenario:
- Installed git bash from https://git-scm.com/download/win
- Added "C:\Program Files\Git\bin" to my path, above "Windows\System32" to override the bash in there
- I can confirm that bash from my cmd session is using the git version
- I cannot see any .bashrc,.profile or .bash_login entry that could be adding in this command
- I have another sperate Windows machine with the same setup and the command works fine there
MZ
: DOS MZ executable. It may be a coincidenceMZ
appears in the error message you got; or not.MZ
is also used for Windows executables (...and UEFI executables), so it's probably that an .exe got accidentally copied to .bashrc, or is beingsource
d out of .bashrc – use Sysinternals Process Monitor to find out what files are being loaded.