Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!gatech!purdue!bu-cs!buengc!bph From: bph@buengc.BU.EDU (Blair P. Houghton) Newsgroups: comp.unix.wizards Subject: Look! An xargs!! (Re: recursive grep) Message-ID: <4026@buengc.BU.EDU> Date: 3 Sep 89 01:16:45 GMT References: <666@lakart.UUCP> <1641@cbnewsl.ATT.COM> <7774@cbmvax.UUCP> <3478@yunexus.UUCP> <1459@jolnet.ORPK.IL.US> Reply-To: bph@buengc.bu.edu (Blair P. Houghton) Followup-To: comp.unix.wizards Organization: Boston Univ. Col. of Eng. Lines: 25 Okay, kids. Shell script 101 is now in session. Try this, after putting it in a file and turning on the execute flag. while read arrrrg do $* $arrrrg done It's in sh(1), so no whining from the "no csh(1)" gallery. I'm sorry, it's dirt simple. That's why I'm not pleased that I have to post it. You all should have thought of it yerselves. It will not work for command2 if it requires special syntax for its file arguments (e.g., dd(1)), and it allows only one filename per invocation of command2 (not efficient if you have a parallel-file-grepping grep, as comes with Umax 4.2 for the Encore Multimax multiprocessing machine, and useless if you're trying to specify both input and output filenames to a single command), but it should suffice for ([ef])grep. --Blair "Sh(1) makes the sound of two hands clapping seem complex without bound."