Determining directory path

Hello,

I have a script where I get the full directory path of the script being executed:

BASE=$0
echo "BASE:" $BASE

The output looks like this:
BASE: /webapps/appsdev/ACURA/rlz/oses3.sh

I'd like to truncate the shell name, leaving just the directory path. The directory path can be any number of levels deep. I think I need to truncate everything right of the last slash in the string.

Any ideas? I'm new at this.

-Thanks

Hi cwalsek

You should try using PWD variable instead:

BASE=$PWD
echo "BASE:" $BASE

Regards

Erwin

man dirname