[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bash question



On Tue, Jul 01, 2003 at 02:04:35PM +0200, Alfredo Valles wrote:
> On Tuesday 01 July 2003 3:18 pm, Colin Watson wrote:
> > There's one mistake in the above even before looking at the contents of
> > "#stuff", namely that you shouldn't be using ls here. Have a look at
> > this document written by a friend of mine:
> 
> >  http://www.greenend.org.uk/rjk/2001/04/shell.html
> 
> Thanks for this article, it's cool.
> 
> It's true in this case you wouldn't use ls but *.  However, there are other 
> times when you want your loop to iterate over the results of other program 
> other that ls, and the question remains valid to these cases.

That's true. In that case the approach exemplified by 'find -print0 |
xargs -0' is the safest one I know.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: