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

Re: OT: bash scripting question -- passing values to ls



On Sun, Jan 04, 2004 at 03:36:36AM -0500, Kevin Mark wrote:
> I use a little bash code over and over again.
> Its a while loop.
> 
> locate charter| grep -i font | while read line; do
> 	ls -l $line;
> done
> 
> It has many uses and it doesnt have a limit like xargs.
> I found out about xargs but started having problems that it could not
> solve so I came up with this!

You can do the same thing with xargs. Look at the -i option.

It's also good practice to quote "$line" like so.

Cheers,

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



Reply to: