A handy utility (at least for me)

Oliver Fromme olli at lurza.secnetix.de
Wed Aug 30 08:27:15 UTC 2006


Thiago Damas <tdamas at gmail.com> wrote:
 >  It can be:
 >  cd /usr/ports
 >  rm -rf */*/work

That could overflow your argument verctor if there's a
large number of work directories.

It's better to use "echo */*/work | xargs rm -rf" if
you don't know the size of the pattern expansion in
advance, especially in shell scripts.  echo is a shell-
builtin, so the argument vector limit doesn't apply.

xargs is your friend.  :-)

Best regards
   Oliver

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"Clear perl code is better than unclear awk code; but NOTHING
comes close to unclear perl code"  (taken from comp.lang.awk FAQ)


More information about the freebsd-hackers mailing list