For directories dirname
gets tripped for ../
and returns ./
.
nolan6000's function can be modified to fix that:
get_abs_filename() { # $1 : relative filename if [ -d "${1%/*}" ]; then echo "$(cd ${1%/*}; pwd)/${1##*/}" fi}
For directories dirname
gets tripped for ../
and returns ./
.
nolan6000's function can be modified to fix that:
get_abs_filename() { # $1 : relative filename if [ -d "${1%/*}" ]; then echo "$(cd ${1%/*}; pwd)/${1##*/}" fi}