Question

In msysGit, when I run type -a tee(.exe), it shows me 3 lines with the same file:

$ type -a tee.exe
tee.exe is /bin/tee.exe
tee.exe is /bin/tee.exe
tee.exe is /bin/tee.exe
tee.exe is /c/Program Files (x86)/Git/bin/tee.exe
tee.exe is /c/Program Files (x86)/Drush/GnuWin32/bin/tee.exe

However, this is not the case when I input the same line in a Fedora 20 VM running on the same machine:

[sean@localhost ~]$ type -a tee
tee is /bin/tee
tee is /usr/bin/tee

Why does this happen?

Was it helpful?

Solution

I found out my PATH has some folders repeated several times. Thanks to @rojomoke for pointing out the possibility.

My msysGit PATH is

$ echo $PATH
/c/Users/Sean/bin:.:/usr/local/bin:/mingw/bin:/bin:/c/Users/Sean/bin:.:/usr/local/bin:/min
n:/c/Users/Sean/bin:.:/usr/local/bin:/mingw/bin:/bin:/c/Program Files (x86)/Git/cmd:/c/Pro
 (x86)/Git/bin:/c/MinGW/bin:/c/MinGW/msys/1.0/bin:/c/Python33/:/c/Program Files (x86)/Inte
ent/:/c/Program Files/Intel/iCLS Client/:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System3
WINDOWS/System32/WindowsPowerShell/v1.0/:/c/Program Files/Intel/Intel(R) Management Engine
s/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x
Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management
mponents/IPT:/c/Program Files/Intel/WiFi/bin/:/c/Program Files/Common Files/Intel/Wireless
/strawberry/c/bin:/c/strawberry/perl/site/bin:/c/strawberry/perl/bin:/c/Program Files/Micr
Platform Installer/:/c/Program Files (x86)/Microsoft ASP.NET/ASP.NET Web Pages/v1.0/:/c/Pr
s (x86)/Windows Kits/8.0/Windows Performance Toolkit/:/c/Program Files/Microsoft SQL Serve
s/Binn/:/c/Program Files (x86)/Microsoft SQL Server/90/Tools/binn/:/c/Program Files/nodejs
am Files (x86)/OpenAFS/Common:/c/Program Files (x86)/QuickTime/QTSystem/:/c/HashiCorp/Vagr
/Ruby200-x64/bin:/c/Users/Sean/AppData/Local/Box/Box Edit/:/c/Program Files (x86)/SSH Comm
 Security/SSH Secure Shell:/c/ProgramData/Drush/:/c/Program Files (x86)/Drush/GnuWin32/bin
m Files (x86)/Drush/Php:/c/Users/Sean/AppData/Roaming/npm:/c/Users/Sean/Documents/Lisp:/c/
les/GCL-2.6.1/lib/gcl-2.6.1/unixport:/c/wamp/bin/mysql/mysql5.6.12/bin:/c/Program Files/Or
alBox:/c/Program Files/Java/jdk1.7.0_51/bin:/c/Program Files/eclipse

This was because I was experimenting with logging into Git Bash. I found out the shortcut to call Git Bash:

`/bin/sh --login -i`

and was experimenting. This line calls all the scripts that are called when Git Bash starts but, as you can probably imagine, it calls them on top of scripts that were already called, and so any files added to the PATH are added again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top