Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101392 - alias expansion ignores $PATH
Summary: alias expansion ignores $PATH
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High minor
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-04 17:00 UTC by William Finn
Modified: 2005-08-05 08:37 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Finn 2005-08-04 17:00:22 UTC
~ $ which mysql
/usr/local/mysql/bin/mysql
~ $ alias live='mysql -uuser -p -hmyhost.example.com -P1337 database'
~ $ live
bash: /usr/bin/mysql: No such file or directory

Reproducible: Always
Steps to Reproduce:
1. install an app in a 'nonstandard' location
2. define an alias to that app
3. run the alias

Actual Results:  
bash: /usr/bin/mysql: No such file or directory

Expected Results:  
Enter password:

in my .bashrc file I have
export PATH=$PATH:/usr/local/mysql/bin
Comment 1 Ciaran McCreesh 2005-08-05 07:42:25 UTC
Does 'hash -d mysql' fix it?
Comment 2 William Finn 2005-08-05 08:11:41 UTC
(In reply to comment #1)
> Does 'hash -d mysql' fix it?

Indeed it does.   ???
Comment 3 SpanKY gentoo-dev 2005-08-05 08:19:29 UTC
do you use bash-completion ?
Comment 4 Ciaran McCreesh 2005-08-05 08:37:42 UTC
Your shell does some caching to avoid having to look for programs every time you
run them. The 'hash' built-in lets you tinker with this. This is fairly standard
and allowed by POSIX:

http://www.opengroup.org/onlinepubs/000095399/utilities/hash.html

So, it's a feature, not a bug.