tholm@uvicctr.UUCP (Terrence W. Holm) (05/05/88)
EFTH Minix report #8 - May 1988 - whereis(1)
This is an implementation of whereis(1) that we
wrote for Minix. Please consider this a public
domain program.
You will probably want to change the $path
to suit your file structure.
Note that this shell script (and all programs
which we submit as shell scripts) are slow.
We decided that for programs whose average
use is only once or twice a day, that it is
better to have a concise working program
than something more complicated.
A "man" page is included.
echo x - whereis
gres '^X' '' > whereis << '/'
X#!/bin/sh
X# whereis(1) efth 1988-Apr-14
X
Xif test $# -ne 1; then
X echo "Usage: whereis name"
X exit 1
X fi
X
Xpath="/bin /etc\
X /usr/bin /usr/local /usr/include\
X /usr/man/cat?\
X /usr/src/efth /usr/src/public\
X /usr/src/commands /usr/src/lib/libc"
X
Xfor dir in $path; do
X for file in $dir/$1 $dir/$1.*; do
X if test -f $file; then
X echo $file
X elif test -d $file; then
X echo $file/
X fi
X done
X done
X
Xexit 0
/
echo x - whereis.1
gres '^X' '' > whereis.1 << '/'
XNAME
X whereis(1) - find where a system file is
X
XSYNOPSIS
X whereis name
X
XDESCRIPTION
X This shell script reports all occurrences of "name" or "name.*"
X in any of the common system directories (see below).
X
XFILES
X /bin
X /etc
X /usr/{bin,local,include}
X /usr/man/cat?
X /usr/src/{efth,public,commands}
X /usr/src/lib/libc
X
XSEE ALSO
X which(1)
/
--------------------------------------------------------------------
Edwin L. Froese
uw-beaver!ubc-vision!mprg!handel!froese
Terrence W. Holm
uw-beaver!uvicctr!sirius!tholm