Summary Files Commits Branches @commit @diff @stats
path: root / Xpath
diff options
context:
space:
mode:
1 files changed, 15 insertions, 0 deletions
-rwxr-xr-xXpath15
diff --git a/Xpath b/Xpath
new file mode 100755
index 0000000..ee349f4
--- /dev/null
+++ b/Xpath
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+case "$1" in
+ (*.*)
+ f="$(find / -type f -name "$(echo "$1.ucxs" | awk '{sub(/\./,"_");print}')")"
+ [ -f "$f" ] && echo "$f"
+ ;;
+ (*)
+ while read -r dir
+ do
+ find "$dir" -type f -name "$1.ucx" && break
+ done <<PATH
+$(echo "$UCX_PATH" | awk '{gsub(/:/,ORS);print}')
+PATH
+esac