Possible Duplicate:
In the bash script how do I know the script file name?
I often need the file system of a bash script to reference other needed resources. Normally use the following code in line after the shebang line. It sets a variable called 'scriptPos' contains the current path of the scripts
scriptPos=${0%/*}
It works fine, but is there something more intuitive to replace the shell expansion?