diff options
author | Peter Carbonetto | 2017-07-18 12:56:21 -0500 |
---|---|---|
committer | Peter Carbonetto | 2017-07-18 12:56:21 -0500 |
commit | 66e2499abdeb663034721425ad6e8efb3340ad99 (patch) | |
tree | 488cd3c971985fcc66579539e2704bb2641aadc4 /shunit2-2.0.3/lib/sh | |
parent | 9c718e1730ffdc78a9154f227250799ab52f7dfa (diff) | |
download | pangemma-66e2499abdeb663034721425ad6e8efb3340ad99.tar.gz |
Added shunint2 v2.0.3 files.
Diffstat (limited to 'shunit2-2.0.3/lib/sh')
-rw-r--r-- | shunit2-2.0.3/lib/sh/shlib | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/shunit2-2.0.3/lib/sh/shlib b/shunit2-2.0.3/lib/sh/shlib new file mode 100644 index 0000000..00aadcb --- /dev/null +++ b/shunit2-2.0.3/lib/sh/shlib @@ -0,0 +1,23 @@ +# $Id$ +# vim:syntax=sh +# +# library of shell functions +# + +shlib_relToAbsPath() +{ + _shlib_path=$1 + + # deal with paths that start with / + echo "${_shlib_path}" |grep '^/' >/dev/null 2>&1 + if [ $? -ne 0 ]; then + _shlib_pwd=`pwd` + _shlib_path="${_shlib_pwd}/${_shlib_path}" + unset _shlib_pwd + fi + + # clean up the path + echo "${_shlib_path}" |sed 's/[^/]*\/*\.\.\/*//g;s/\/\.\//\//' + + unset _shlib_path +} |