Mail Archives: cygwin/2010/05/19/15:51:28
--------------enig4AF731CB8228D7B95D250CE4
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
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
last found the command, but that location is relative. You either need
to disable 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 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 as the LAST item in my PATH, so that any application I am likely to
run occurs earlier in the PATH). But ./bin? Seriously, change your
path to call out an absolute path of ~/bin instead of using ./bin and
relying on the first invocation being from ~. That way, bash will hash
the absolute name in the first place.
At which point, this is no longer a cygwin-specific question - you would
get the same behavior on Linux.
--=20
Eric Blake eblake AT redhat DOT com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
--------------enig4AF731CB8228D7B95D250CE4
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iQEcBAEBCAAGBQJL9EEWAAoJEKeha0olJ0NqqI4H/AvhMc4zmW49/sg1Te720ORQ
eISluRhjctlhkM4DEydWJWUaz10UhfNlOGtmOHAGV9paXFekHff1G6dMxHZ34IFk
zKqktbIgPTGueraPcbvUapwPAHhhWRFI/DTYBY5d0EP3xj4b9cXUlabfjenzXFY0
/yyTeJLN4OiOm1WOyYbO+5kUuYRPZABfipdIdPiIxacVybrWCHHTy5m/8PweN7Gz
zJZiTTGM4W6spkgohRRAvdN4aXBWmA5blQ04FsGnA1CJmCpgpLJaTAv2wYGElVAE
6UW4i6y6S6CBKiI2fPZPTM4/Dhqo86HoMk+nIr1CUgRltK5K1GCzHOQ5HssxiVk=
=/jmh
-----END PGP SIGNATURE-----
--------------enig4AF731CB8228D7B95D250CE4--
- Raw text -