Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!agate!ig!uwmcsd1!bbn!mit-eddie!uw-beaver!ssc-vax!uvicctr!tholm From: tholm@uvicctr.UUCP (Terrence W. Holm) Newsgroups: comp.os.minix Subject: which(1) Message-ID: <453@uvicctr.UUCP> Date: 12 Jul 88 23:02:00 GMT Reply-To: tholm@uvicctr.UUCP (Terrence W. Holm) Organization: University of Victoria, Victoria B.C. Canada Lines: 35 [I have been asked to repost this.] EFTH Minix report #7 - May 1988 - which(1) This is an implementation of which(1) for MINIX. Please consider this a public domain program. -------------------------------------------------------------------- #!/bin/sh # which(1) efth 1988-Apr-14 if test $# -ne 1; then echo "Usage: which program" exit 1 fi path="`IFS=: eval echo $PATH`" for dir in . $path; do filename=$dir/$1 if test -f $filename -a -x $filename; then echo $filename exit 0 fi done echo "No $1 in . $path" exit 1 -------------------------------------------------------------------- Edwin L. Froese uw-beaver!ubc-cs!mprg!handel!froese Terrence W. Holm uw-beaver!ubc-cs!uvicctr!sirius!tholm