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

2004-01-06 Thread David Z Maze
Matt Price [EMAIL PROTECTED] writes: here's something that ocmes up a lot for me: I use locate to find a bunch of files: % locate charter | grep -i font /usr/share/texmf/fonts/afm/bitstrea/charter /usr/share/texmf/fonts/tfm/bitstrea/charter /usr/share/texmf/fonts/type1/bitstrea/charter

OT: bash scripting question -- passing values to ls

2004-01-04 Thread Matt Price
hey folks, here's something that ocmes up a lot for me: I use locate to find a bunch of files: % locate charter | grep -i font /usr/share/texmf/fonts/afm/bitstrea/charter /usr/share/texmf/fonts/tfm/bitstrea/charter /usr/share/texmf/fonts/type1/bitstrea/charter

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

2004-01-04 Thread Nano Nano
On Sun, Jan 04, 2004 at 02:27:11AM -0500, Matt Price wrote: so I have to do it by hand at the moment. But shouldn't I be able to automate it with somthing like: ls locate charter | grep -i font ? nothing I try works -- but I can't believe it's impossible! any hints? I use backticks:

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

2004-01-04 Thread Kevin Mark
On Sun, Jan 04, 2004 at 02:27:11AM -0500, Matt Price wrote: hey folks, here's something that ocmes up a lot for me: I use locate to find a bunch of files: % locate charter | grep -i font /usr/share/texmf/fonts/afm/bitstrea/charter /usr/share/texmf/fonts/tfm/bitstrea/charter

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

2004-01-04 Thread Nano Nano
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

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

2004-01-04 Thread Nano Nano
On Sun, Jan 04, 2004 at 01:10:51AM -0800, Nano Nano wrote: [snip] it looks messier) and you can't use the sort options of less, for i meant sort options of ls -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]

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

2004-01-04 Thread Colin Watson
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

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

2004-01-04 Thread Paul Morgan
On Sat, 03 Jan 2004 23:34:59 -0800, Nano Nano wrote: On Sun, Jan 04, 2004 at 02:27:11AM -0500, Matt Price wrote: so I have to do it by hand at the moment. But shouldn't I be able to automate it with somthing like: ls locate charter | grep -i font ? nothing I try works -- but I can't

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

2004-01-04 Thread Gregory Seidman
On Sun, Jan 04, 2004 at 02:27:11AM -0500, Matt Price wrote: [...] } ls locate charter | grep -i font } ? } nothing I try works -- but I can't believe it's impossible! any } hints? locate charter | grep -i font | tr '\012' '\000' | xargs -0 ls -ld xargs is your friend. So is tr. Learn them