diff options
Diffstat (limited to 'parser/html/java/htmlparser/mozilla-export-scripts/util.sh')
-rw-r--r-- | parser/html/java/htmlparser/mozilla-export-scripts/util.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/parser/html/java/htmlparser/mozilla-export-scripts/util.sh b/parser/html/java/htmlparser/mozilla-export-scripts/util.sh new file mode 100644 index 0000000000..348ca14f9f --- /dev/null +++ b/parser/html/java/htmlparser/mozilla-export-scripts/util.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +abs() { + local rel + local p + if [ $# -ne 1 ] + then + rel=. + else + rel=$1 + fi + if [ -d $rel ] + then + pushd $rel > /dev/null + p=`pwd` + popd > /dev/null + else + pushd `dirname $rel` > /dev/null + p=`pwd`/`basename $rel` + popd > /dev/null + fi + echo $p +} |