3 #not perfect--if the thing has not path in front at all, not even a '.',
4 #then the code below fails since it can't cd into that portion.
6 absolute_path=$(cd ${0%/*} && echo $PWD/${0##*/})
8 path_only=$(dirname "$absolute_path")
10 echo absolute path to item: $absolute_path
11 echo just the directory: $path_only