in reply to Pathfinder - find duplicate (shadowed) programs in your PATH
I like how the code identifies duplicate PATH directories by using the inode. The system administrators who set up the environment I use at $work have added in a few duplicate directories. In my case, they are not links; so the warning message is a little misleading, but the important thing is that I get some kind of warning.
Currently, the code only filters out the specially-name directories (. and ..). I adapted the code to filter out all directories which are sub-directories of each PATH directory. Also, I filter out all files which do not have execute permissions.
To add these filters, change:
sort grep !/^\.\.?$/,
to:
sort grep {-x "$dir/$_"} grep {! -d "$dir/$_"}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Pathfinder - find duplicate (shadowed) programs in your PATH
by parv (Parson) on Jul 21, 2009 at 04:17 UTC | |
by toolic (Bishop) on Jul 22, 2009 at 01:37 UTC | |
by parv (Parson) on Jul 22, 2009 at 12:02 UTC |
In Section
Code Catacombs