aboutsummaryrefslogtreecommitdiff
path: root/core/busybox/files/which
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-05-12 00:07:52 +0300
committerCem Keylan <cem@ckyln.com>2020-05-12 00:07:52 +0300
commitcfcba38a04e4e64e3b5f7637a9973b18aa604b95 (patch)
tree1432eec754edff09561760c716c3bedd6f19a388 /core/busybox/files/which
parent3709b835d2b5d90dc1e8da9ffd872e2c67bdbc7b (diff)
downloadrepository-cfcba38a04e4e64e3b5f7637a9973b18aa604b95.tar.gz
busybox: add new utilities
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