Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-Id: <6.0.1.1.1.20040515210156.027f81a0@mail.ros.com.au> X-Sender: errol AT mail DOT ros DOT com DOT au (Unverified) Date: Sat, 15 May 2004 21:21:42 +1000 To: cygwin AT cygwin DOT com From: Errol Smith Subject: "which" with path $HOME/bin vs ~/bin In-Reply-To: <1084354738.4303.ezmlm@cygwin.com> References: <1084354738 DOT 4303 DOT ezmlm AT cygwin DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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 " 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 rather than 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/