source: trunk/minix/commands/scripts/whereis.sh@ 21

Last change on this file since 21 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 425 bytes
Line 
1#!/bin/sh
2: List all system directories containing the argument
3: Author: Terrence W. Holm
4if test $# -ne 1; then
5 echo "Usage: whereis name"
6 exit 1
7fi
8
9path="/bin /lib /etc\
10 /usr/bin /usr/lib\
11 /usr/include /usr/include/sys"
12
13for 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
23exit 0
Note: See TracBrowser for help on using the repository browser.