Mail Archives: cygwin/2010/05/19/17:08:42
-----Original Message-----
> From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf =
Of Eric Blake
> Sent: Wednesday, May 19, 2010 2:51 PM
> To: cygwin AT cygwin DOT com
> Subject: Re: bash - command - PATH question
>
> On 05/19/2010 01:42 PM, Rockefeller, Harry wrote:
> > $ type mysvn
> > mysvn is hashed (./mysvn)
>
> There's your problem. Bash remembers the hashed location of where it las=
t found the command, but that location is relative. You either need to dis=
able bash's hashing, or force it to re-evaluate its hash as soon as you are=
in a different directory. 'shopt -s checkhash'.
>
> > $ echo $PATH
> > [gives a very long path. Yes, ./ and ./bin are present but are the=20
> > only relative paths in the listing.]
>
> Obligatory comments about having '.' in your PATH being a security hole, =
opening the door for trojan horse applications. (Well, I do it, but only a=
s the LAST item in my PATH, so that any application I am likely to run occu=
rs earlier in the PATH). But ./bin? Seriously, change your path to call o=
ut an absolute path of ~/bin instead of using ./bin and relying on the firs=
t invocation being from ~. That way, bash will hash the absolute name in t=
he first place.
> At which point, this is no longer a cygwin-specific question - you would =
get the same behavior on Linux.
Thanks for your help in tracking this down.
I found out that ./ and ./bin were being prepended to PATH by Mortens Cygwi=
n X-Launcher.
FWIW, ./ is in the default PATH in Mortens Cygwin X-Launcher.=20=20
I removed them from there and added "export PATH=3D$PATH:~/bin/:./bin/:./" =
to ~/.bash_login.
Everything began working correctly afterward.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -