Re: [OT] Collective memory query
On Wed, Sep 29, 2004 at 10:08:28PM +0200, Adrian 'Dagurashibanipal' von Bidder wrote:
> On Tuesday 28 September 2004 15.49, Bartosz Fenski aka fEnIo wrote:
> > On Mon, Sep 27, 2004 at 06:38:03PM +0200, Adrian 'Dagurashibanipal' von
> Bidder wrote:
> > > > for foo in `find . -name "something"`
> > >
> > > Note that
> > > $ for foo in `command outputting a list of filenames`
> > >
> > > should *always* be replaced by
> > >
> > > $ said command | while read foo; do ...
> > So what is the magic barrier when this should stop working?
> > I'm just curious.
> Hmm. I can't comment on that specifically, for current versions of some
> shells. I know I have seen 'command line too long' messages in the past
> when using `find ...` constructs, and I bet that on busybox based resscue
> disks and other restricted shells this topic will still be relevant.
The "line too long" limit applies when trying to execve(2) anything.
There's a limit there. For shell built-ins, there doesn't have to be a
limit, but as you point out, busybox might have one.
> In any case, using the while loop will pipeline the operations so you get
> full benefit from multitasking.
Yeah, that's an elegant idiom. I'll have to remember to use it in the
#define X(x,y) x##y
Peter Cordes ; e-mail: X(peter@cor , des.ca)
"The gods confound the man who first found out how to distinguish the hours!
Confound him, too, who in this place set up a sundial, to cut and hack
my day so wretchedly into small pieces!" -- Plautus, 200 BC