03a507ddeae9440c5acf31ff2d3b94bc8f7cc811
[feisty_meow.git] / scripts / core / get_parent_dir.sh
1 #!/bin/bash
2
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.
5
6 absolute_path=$(cd ${0%/*} && echo $PWD/${0##*/})
7
8 path_only=$(dirname "$absolute_path")
9
10 echo absolute path to item: $absolute_path
11 echo just the directory: $path_only