Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!hacgate!lori From: lori@hacgate.UUCP (Lori Barfield) Newsgroups: comp.sys.apollo Subject: Handy Aegis Script Message-ID: <6354@hacgate.UUCP> Date: 6 Dec 89 00:11:54 GMT Organization: Hughes Aircraft Company, El Segundo CA Lines: 50 Now that I'm a sysadmin on Unix systems instead of an Aegis net, I'm not sure what to do with those oh-so-handy shellscripts I used to depend on. Before I throw them out forever, thought I'd throw one on the net and see if anyone is interested in spending bandwidth on sharing Aegis scripts in this forum. All of my Aegis stuff was written on SR9; better ways may exist now. This script searches a dir for a string, ignoring .bin and .bak files, defaulting to current dir. ---------------------------------- cut here --------------------------------- ############################################################################## # TITLE : pat # # ARG 1 : (required, prompted with omission) pattern to find in non-.BAK # # ASCII files in current directory # # ARG 2 : (optional) directory to search # # ARG 3 : (optional) std FPAT list option (such as -LF or -LM) # # METHOD: scans current (or given) dir for non-.BAK ASCII files, calls FPAT # # AUTHOR: Lori Barfield # # REV. : 3-31-89 # ############################################################################## # # *** set up shell # eon # # *** variables # frag := ''; files := ''; file := ''; junk := ''; listop := ''; ch1 := ''; line := ''; # # *** parameters # if eqs ^1 then read -p 'Enter fragment: ' frag else frag := ^1 endif if eqs ^2 then files := './?*' else files := "^2/?*" endif if eqs ^3 then listop := '-lm' else listop := ^3 endif # # *** execution # /com/ld ^files -nhd -c -lf -ab | /com/fpat -x '.bak' 'bin' | @ while readln line do for ch1 in ^line by char exit endfor # sift out mailboxes and whatever if ((^ch1 <> ' ')) then args ^line | read junk file /com/fpat ^listop -l -i -rmf 20 ^file -p ^frag endif enddo