Mike Miller wrote:
> My apologies to Kathryn Hogg.  It seems that you are correct because if I
> run "echo $0" within the script it returns the full path from $PATH even
> when nothing but the filename was typed on the command line.

To be honest, I was pleasantly surprised the first time I found out that
$0 would expand to the full pathname many years ago.

> So then, does Kathryn's method always work? (with quotes around $0):
>
> (cd $(dirname "$0"); pwd)
>
> I think maybe it does.  It is an elegant solution.

That definitely won't work.  It will fix the dirname but then cd would see
something like
cd /yes/i am/stupid.  so we need to quote the arguments to both dirname
and cd.

-- 
Kathryn
http://womensfooty.com