delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/15/07:20:45

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <errol AT ros DOT com DOT au>
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

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019