coverity appeasement
[minix.git] / commands / whereis / whereis.sh
blob2dfe0c52e391d8bd1ec63511933b02129f4c3c8b
1 #!/bin/sh
2 : List all system directories containing the argument
3 : Author: Terrence W. Holm
4 if test $# -ne 1; then
5 echo "Usage: whereis name"
6 exit 1
7 fi
9 path="/bin /lib /etc\
10 /usr/bin /usr/lib\
11 /usr/include /usr/include/sys"
13 for dir in $path; do
14 for file in $dir/$1 $dir/$1.*; do
15 if test -f $file; then
16 echo $file
17 elif test -d $file; then
18 echo $file/
20 done
21 done
23 exit 0