This is the mail archive of the
cygwin
mailing list for the Cygwin project.
"which" with path $HOME/bin vs ~/bin
- From: Errol Smith <errol at ros dot com dot au>
- To: cygwin at cygwin dot com
- Date: Sat, 15 May 2004 21:21:42 +1000
- Subject: "which" with path $HOME/bin vs ~/bin
- References: <1084354738.4303.ezmlm@cygwin.com>
I recently switched my path from containing "$HOME/bin" to "~/bin" (by updating to a more recent skeleton of .bash_profile and removing stuff from my own .bashrc).
Now a bash script of mine that uses "which <executable>" to see if a program exists started failing on programs contained in my ~/bin directory.
If I rename those programs by removing the ".exe" eg "pngcrush.exe" to "pngcrush" then "which pngcrush" starts working, but the programs themselves become unreliable (as you would expect? - I believe cygwin programs must be named *.exe?). So it seems "which" is now looking for <program> rather than <program.exe> in my ~/bin directory.
I think this is a bug in "which" as if I remove the "which" check from my script, the script works and the programs in ~/bin are run as expected with the ~/bin variation of PATH.
My workaround was to change .bash_profile:
PATH="~/bin:${PATH}"
to:
PATH="$HOME/bin:${PATH}"
which is what I was using before (this wont work if $HOME is not defined I guess).
Is this a bug in "which"? (is it a bug?
Regards, Errol
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/