Look! An xargs!! (Re: recursive grep)
Blair P. Houghton
bph at buengc.BU.EDU
Sun Sep 3 11:16:45 AEST 1989
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."
More information about the Comp.unix.wizards
mailing list