How can I determine the path of a shell script that I'm running right now ?
ok, I'm in:
and I'm running:
I need for main.sh to know the path it is running in - no matter from where I'm running it.
the $0 is the closest I got so far, the only problem is $0 also contains the name of the file itself ("main.sh") and I only want the path ("/usr1/Asher/home/scripts/")
any ideas ?
oh and I would rather not use the "cd" command in the script because it is needed to be in the same place later in the script.
Last edited by basher400; 10-25-2006 at 07:39 AM.