Look! An xargs!! (Re: recursive grep)

Adam R de Boor deboor at buddy.Berkeley.EDU
Mon Sep 4 09:06:57 AEST 1989


Shell scripts 201 (Graduate level :)

#!/bin/sh -
args=""
while read arg; do
	args="$args $arg"
done
$* $args


Problems with args like -m'this thing has spaces' when given to the above
script are left as an exercise for the reader.

While the lecturer in SS101 was wrong in his solution of the problem (or
perhaps misunderstood the problem itself), his contention that xargs can
be solved with a rudimentary shell script is correct, q.e.d. (or some
similar abbreviation, hee hee)

a



More information about the Comp.unix.wizards mailing list