On Sat, 13 Aug 2005, Giorgos Keramidas wrote: > On 2005-08-12 13:38, Benson Wong <[EMAIL PROTECTED]> 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''.
True. Of course if you've got that many core files lying around, you probably have other things to worry about :) > 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. Maybe measurable. Took me ages to appreciate the difference between say cat tempfile | while read line; do stuff with $line; done and while read line; do stuff with $line; done < tempfile when 'stuff' needs to update script-scope variables, despite a slightly icky, impure feeling about using tempfiles .. cheers, Ian _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"