aboutsummaryrefslogtreecommitdiffstats
path: root/which
blob: 473c8917b76e7b17d61e7324b5a4c7c72829e1b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
arg=$1
for d in `echo $PATH | sed -e 's/:/ /g'`
do
	if [ -x $d/$arg ]; then
		echo $d/$arg
		exit 0
	fi
done
echo "${arg}: Command not found."
exit 1