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

Jerry Krinock jerry at ieee.org
Fri May 23 12:00:31 PDT 2008


On 2008 May, 23, at 11:55, Eric F Crist wrote:

> His current working directory may not be . relative to the directory  
> his script and tool reside in.  I think that's the rub.  dirname $0  
> I think is his best solution, aside from having his friend possibly  
> put his script and/or tool somewhere within their PATH.

Yes, at first I found that the other methods didn't work when I ran  
the script as a .command by doubleclicking it.  But then when I  
retested, the PWD was the directory that the script was in.  Anyhow,  
I'm using dirname $0 since I agree it is safer.



More information about the X-Unix mailing list