Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jan 2002 21:48:40 +0100 (CET)
From:      Oliver Fromme <olli@secnetix.de>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Overriding ARG_MAX
Message-ID:  <200201052048.g05KmeW55815@lurza.secnetix.de>
In-Reply-To: <Pine.BSF.4.21.0201042248520.27496-100000@search.sparks.net>

next in thread | previous in thread | raw e-mail | index | archive | help
David Miller <dmiller@sparks.net> wrote:
 > What I usually want to do is something more like ls *.out |wc -l

ls | grep '\.out$' | wc -l

 > or grep something *.data

ls | grep '\.data$' | xargs grep something

 > or cat *.foo | grep something.

ls | grep '\.foo$' | xargs cat | grep something

In general, changing ARG_MAX is bad for several reasons.
 - It makes your commands nonportable.
 - It only hides the actual problem without really solving
   it.
 - It just moves the limit further away, but it doesn't
   remove it.

The alternative commands that I suggested above are
portable and work for _any_ number of files, no matter
what the ARG_MAX limit is.  Sure, they're a bit longer
to type, but if you're concerned about that, then you
could wrap them into small scripts or shell functions.

Regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"All that we see or seem is just a dream within a dream" (E. A. Poe)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201052048.g05KmeW55815>