aboutsummaryrefslogtreecommitdiff
path: root/core/busybox/files/which
blob: 76bf5c279627c4a457af3ad293084f789303f630 (plain)
1
2
3
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