scre.git

which.sh

espurr
#!/bin/sh
# which - find command path
# Copyright (C) 2022-2023 ArcNyxx <me@arcnyxx.net>
# see LICENCE file for licensing information

[ -z "$1" ] && exit 1
for TARG in `echo "$PATH" | tr ':' ' '` ; do
	ls "$TARG/$1" 2>/dev/null && exit 0
done

echo "which: no $1 in \$PATH"
exit 1