source:
trunk/minix/commands/scripts/whereis.sh@
10
Last change on this file since 10 was 9, checked in by , 14 years ago | |
---|---|
File size: 425 bytes |
Line | |
---|---|
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 |
Note:
See TracBrowser
for help on using the repository browser.