[comp.os.minix] whereis whereis

ast@cs.vu.nl (Andy Tanenbaum) (01/06/89)

In article <6216@louie.udel.EDU> jnall%FSU.BITNET@cunyvm.cuny.edu (John Nall 904-644-5241) writes:
>The man_guide for 1.3d indicates that the whereis command exists.  However,
>my source for 1.3d (which came from the D1.2-1.3 file from bugs.nosc.mil)
>does not include it.  

Hereis whereis.  It is in /usr/bin only (not in commands).

Andy Tanenbaum

----------------------------------- whereis --------------------------------
: List all system directories containing the argument
: Author: Terrence W. Holm
if test $# -ne 1; then
  echo "Usage:  whereis  name"
  exit 1
fi

path="/bin /lib /etc\
      /usr/bin /usr/lib\
      /usr/include /usr/include/sys"

for dir in $path; do
  for file in $dir/$1 $dir/$1.*; do
    if test -f $file; then
      echo $file 
    elif test -d $file; then
      echo $file/
      fi
    done
  done

exit 0