]> git.mdlowis.com Git - projs/tide.git/commitdiff
added pick wrapper to pick and execute an executable
authorMichael D. Lowis <mike.lowis@gentex.com>
Thu, 7 Nov 2019 21:36:05 +0000 (16:36 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Thu, 7 Nov 2019 21:36:05 +0000 (16:36 -0500)
bin/pickexec [new file with mode: 0755]

diff --git a/bin/pickexec b/bin/pickexec
new file mode 100755 (executable)
index 0000000..2bebba7
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+IFS=:
+bin="$(for p in $PATH; do
+  printf "%s\n" "$p"/*
+done | pick)"
+[ "" != "$bin" ] && "$bin"