Notable bash $PATH behavior trivia
Michael O'Donnell
mod+gnhlug at std.com
Thu Jan 2 17:18:49 EST 2003
I just noticed that I was able to execute
programs in the current directory without
prefixing their names with ./ and without
having . in my $PATH. After saying WTF?
a number of times I finally figured out that
it's related to my PATH being defined with
a leading colon, sorta like this:
export PATH=:/bin:/usr/bin:/usr:local/bin
...so those of you who (for security reasons) are
careful to exclude "." from your $PATH need also
be careful about leading colons, apparently...
More information about the gnhlug-discuss
mailing list