[X-Unix] Shell Script: How get parent path to invoke a sister tool?

Jerry Krinock jerry at ieee.org
Fri May 23 07:21:48 PDT 2008


I want to ship someone a directory containing two files: a shell  
script and a tool.  Within the shell script, I'd like to invoke the  
tool.  And I want it idiot-proofed to work regardless of where the  
user drops my directory.

So, I need the path to the tool within the script.  It seems like a  
bash shell script should have an environment variable available giving  
the path to it's own parent directory, but I don't see any such thing  
in printenv output.

How can I do this?

Thanks,

Jerry Krinock


More information about the X-Unix mailing list