Ron Johnson wrote:
On Mon, 2006-01-16 at 08:40 +1100, Tim Connors wrote:<snip> Why on earth would you want to put ls in backticks? I wonder who originated this rather redundant and fragile (what happens when afilename has any form of whitespace?) construct?
That would be me.
If you're dealing with so many files that the bash "glob buffer" fills up, `ls *.bmp` can work around that.
And imho, much easier than dealing with xargs and find -exec whatnot ; Also, if spaces are a problem, fancy quotes can deal with that: for f in `ls *.bmp`; do echo "$f"; done <-- Note I have NOT tested this.
Try googling for "useless use of cat awards" for another redundant construct that people love to use. for f in *.bmp ; do convert $f --to-jpeg ; done But even better than the above is just: mogrify -format jpg *.bmp You can probably also (untested): convert --to-jpeg *.bmp