From owner-freebsd-hackers Sat Jan 5 14:25:27 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from lurza.secnetix.de (lurza.secnetix.de [212.66.1.130]) by hub.freebsd.org (Postfix) with ESMTP id A6D4037B427 for ; Sat, 5 Jan 2002 14:25:10 -0800 (PST) Received: (from olli@localhost) by lurza.secnetix.de (8.11.6/8.11.6) id g05MPHf59931; Sat, 5 Jan 2002 23:25:17 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Date: Sat, 5 Jan 2002 23:25:17 +0100 (CET) Message-Id: <200201052225.g05MPHf59931@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG Reply-To: freebsd-hackers@FreeBSD.ORG Subject: Re: Overriding ARG_MAX In-Reply-To: <20020105211124.GA76316@ussenterprise.ufp.org> X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.4-RELEASE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Leo Bicknell wrote: > In a message written on Sat, Jan 05, 2002 at 09:48:40PM +0100, Oliver Fromme wro > te: > > ls | grep '\.out$' | wc -l > > One process shorter: find -name "*.out" -maxdepth 0 | wc -l OK, but I tried to be as portable as possible, while -maxdepth is not portable (e.g. Solaris doesn't have it). > > ls | grep '\.data$' | xargs grep something > > Two problems, first use find, second use /dev/null: > find -name "*.data" -maxdepth 0 | xargs grep something /dev/null But that one will give you different result than the original command. I'm well aware of the /dev/null issue, but this wasn't the question in the first place. > > ls | grep '\.foo$' | xargs cat | grep somethingA > > A completely unnecessary use of cat. Yep, already in the original command, so I kept it. (I had already typed a comment about "useless use of cat" in my mail, but deleted it again, thinking that it was intentional to achieve the same effect as grep -h.) > You can't do that with ls | grep, since only the filenames make it > to grep. You could do it with ls -l | awk, though. ;-) 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