summaryrefslogtreecommitdiff
path: root/include/lib.sh
diff options
context:
space:
mode:
Diffstat (limited to 'include/lib.sh')
-rw-r--r--include/lib.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/lib.sh b/include/lib.sh
index 950a07c8..99e59a1a 100644
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -144,6 +144,18 @@ singletree()
return 1
}
+findpath()
+{
+ [ $# -gt 0 ] || err "findpath: No arguments provided"
+ while [ $# -gt 0 ]; do
+ found="`readlink -f "$1" 2>/dev/null`" || return 1; :
+ [ -n "$found" ] || found="`realpath "$1" 2>/dev/null`" || \
+ return 1; :
+ printf "%s\n" "$found"
+ shift 1
+ done
+}
+
fx_()
{
fd="`mktemp`" && x_ rm -f "$fd" && x_ touch "$fd"