aboutsummaryrefslogtreecommitdiff
path: root/core/busybox/files/which
diff options
context:
space:
mode:
Diffstat (limited to 'core/busybox/files/which')
-rwxr-xr-xcore/busybox/files/which4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/busybox/files/which b/core/busybox/files/which
new file mode 100755
index 00000000..76bf5c27
--- /dev/null
+++ b/core/busybox/files/which
@@ -0,0 +1,4 @@
+#!/bin/sh
+[ "$1" ] || { printf 'usage: %s <command>\n' "${0##*/}"; exit 0;}
+IFS=:; for path in $PATH; do [ -x "$path/$1" ] && { printf '%s\n' "$path/$1"; exit 0;}; done
+exit 1