Re: OT: bash scripting question -- passing values to ls
On Sun, Jan 04, 2004 at 03:36:36AM -0500, Kevin Mark wrote:
[snip]
>
> locate charter| grep -i font | while read line; do
> ls -l $line;
> done
Invoking 'ls' in a loop is semantically different from invoking it once,
although you can compensate for it. I prefer backticks because you can
pipe the whole thing to less (although you can pipe a for loop to less,
it looks messier) and you can't use the sort options of less, for
example.
Tomato, tomato. For loop is nice for somethings.
Also starting a process per file might be more expensive than a single
process with lots of args (but not in this case).
Reply to: