Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Aug 2005 06:19:12 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Benson Wong <tummytech@gmail.com>
Cc:        Xu Qiang <Qiang.Xu@fujixerox.com>, Ian Smith <smithi@nimnet.asn.au>, freebsd-questions@freebsd.org
Subject:   Re: Help on bash script?
Message-ID:  <20050813031912.GB1938@gothmog.gr>
In-Reply-To: <860807bf050812133839dd8f46@mail.gmail.com>
References:  <20050812013604.8C12D16A422@hub.freebsd.org> <Pine.BSF.3.96.1050813044601.8009A-100000@gaia.nimnet.asn.au> <860807bf050812133839dd8f46@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-08-12 13:38, Benson Wong <tummytech@gmail.com> wrote:
> I prefer:
>
> for COREFILE in `find / -type f -name core -print`
> do
>   ...
> done
>
> Wouldn't that accomplish the same thing?

More or less.  Less, when the filenames are too many.  See questions
posted on this very same list about ``too many arguments''.

The ``while read line; do stuff with $line; done'' loop doesn't suffer
from the same limitation, but is a bit more expensive in terms of the
number of spawned processes and (consequently) the time it takes to run.




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