Joined: July 2004
||Posted: Mar. 30 2006,20:13
I'm not sure what you're suggesting. As far as I know, the whereis command works only with PATH and MANPATH, so it wouldn't apply if the script is in a directory that is not in $PATH. Even using the absolute path to the wrapper as an argument to whereis still returns only files in $PATH and $MANPATH. It also returns multiple paths, so it would somehow need to know which path is needed.
The thing I'm really attempting to achieve is the ability to have the wrapper cd into its own directory no matter where it is located or how the user has started the script (whether it's directly run, or from a symlink, or from an alias, or some other method), and be able to use that same piece of script any time i need to reuse this behavior in other wrappers. The script above does almost exactly what I want, but it uses something like 6 or 7 commands. The way I see it, the more programs that are required to accomplish a single task, the less portable it may be.
So this does work, but I was just looking for a way to make it more compact and portable.