From owner-freebsd-questions@FreeBSD.ORG Wed Feb 27 14:21:58 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18009106566B for ; Wed, 27 Feb 2008 14:21:58 +0000 (UTC) (envelope-from fbsd06+TQ=e8b94b1b@mlists.homeunix.com) Received: from mxout-04.mxes.net (mxout-04.mxes.net [216.86.168.179]) by mx1.freebsd.org (Postfix) with ESMTP id EAD248FC16 for ; Wed, 27 Feb 2008 14:21:57 +0000 (UTC) (envelope-from fbsd06+TQ=e8b94b1b@mlists.homeunix.com) Received: from gumby.homeunix.com. (unknown [87.81.140.128]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTP id C5039D0B9D for ; Wed, 27 Feb 2008 09:21:56 -0500 (EST) Date: Wed, 27 Feb 2008 14:21:53 +0000 From: RW To: freebsd-questions@freebsd.org Message-ID: <20080227142153.73b5a680@gumby.homeunix.com.> In-Reply-To: <20080227111551.GA2403@kobe.laptop> References: <20080227100132.G1831@wojtek.tensor.gdynia.pl> <47C52A64.5000701@locolomo.org> <20080227111551.GA2403@kobe.laptop> X-Mailer: Claws Mail 3.3.0 (GTK+ 2.12.8; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: argument list too long X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2008 14:21:58 -0000 On Wed, 27 Feb 2008 13:15:51 +0200 Giorgos Keramidas wrote: > It is worth noting, however, that there are usually fairly easy ways > to work with huge lists of command-line arguments. Instead of writing > things like this, for example: > > for file in *.ogg ; do > blah "${file}" > done I've seen loops like this suggested as an alternative to blah *.ogg and the two cases are clearly different, because in the loop you only pass one argument to "blah", and the limitation is in how much space the shell will allow for the expansion of *.ogg. I've not hit this limit with /bin/sh. Anyone know what it is? > one can easily write: > > find . -name '*.ogg' | \ > while read file ; do \ > blah "${file}" > done If blah is interactive, it will try to take its input from the pipe instead of the terminal. Is there a way around this? (I know xargs can handle it with -o)