Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!unido!laura!jf@laura.UUCP From: jf@laura.UUCP (Jan-Hinrich Fessel) Newsgroups: comp.os.minix,sub.sources.minix Subject: which Keywords: shar Message-ID: <1193@laura.UUCP> Date: 10 Mar 89 16:56:34 GMT Sender: jf@laura.UUCP Reply-To: jf@laura.UUCP (Jan-Hinrich Fessel) Organization: University of Dortmund, W-Germany Lines: 63 Hi out there! This is The Ultimate Solution for those of you who always wanted to know which program they have executed:-) BTW, can anyone repost the first part of alltar.*, it seems it never reached Europe (maybe it was larger than 100k?). If it is larger than 100k, please split it in order to cross the atlantic #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh which << '/_SHAR_EOF_' X: List all system directories containing the argument X: Author: Jan-Hinrich Fessel Xif test $# -ne 1; then X echo "Usage: which name" X exit 1 Xfi X Xecho Xecho -n $1 :' ' Xpath="`echo $PATH | tr 'A-Za-z/:' 'A-Za-z/ '`" 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 echo X exit 0 X fi X done Xdone Xecho No $1 in $path Xecho Xexit 1 X X /_SHAR_EOF_ fi # End of overwriting check echo shar: end of shell archive exit 0 Jan-Hinrich Fessel Universitaet Dortmund, IRB jf@unido.uucp || jf@unido.bitnet There's no way to delay that trouble comin' every day... F.Z. =============================================================================