repo.or.cz
/
minix.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
opendir change: refinement
[minix.git]
/
commands
/
whereis
/
whereis.sh
blob
2dfe0c52e391d8bd1ec63511933b02129f4c3c8b
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
8
9
path
=
"/bin /lib /etc\
10
/usr/bin /usr/lib\
11
/usr/include /usr/include/sys"
12
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
/
19
fi
20
done
21
done
22
23
exit
0