aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/command_all.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/command_all.sh')
-rwxr-xr-xscripts/command_all.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/command_all.sh b/scripts/command_all.sh
new file mode 100755
index 0000000000..452b66f092
--- /dev/null
+++ b/scripts/command_all.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Reduced version of which -a using command utility
+
+case $PATH in
+ (*[!:]:) PATH="$PATH:" ;;
+esac
+
+for ELEMENT in $(echo $PATH | tr ":" "\n"); do
+ PATH=$ELEMENT command -v "$@"
+done