[ale] Bash question: | in find

James P. Kinney III jkinney at localnetsolutions.com
Fri Jan 24 09:36:23 EST 2003


This is why I use Linux!!!!!

On Fri, 2003-01-24 at 00:06, Geoffrey wrote:
> I'm trying to figure out what you're trying to do there. I think you're 
> trying to locate the tarball that contains the Xawd library?? Why not 
> let tar do the 'grep' for you:
> 
> for fn in $(find /cdrom/slackware -name '*.tgz' -print); do
> 	echo -n $fn " "
> 	tar tvzf $fn '*libXaw3d*' 2>/dev/null
> done |grep Xaw3d
> 
> 'echo -n' will print the file name without a newline, so the output of 
> tar will be appended to the filename, and the 'grep' on the output of 
> the for loop will print only those lines that contain the Xaw3d, hence 
> all the files that did not contain the file you're looking for will be 
> filtered out.
> 

-- 
James P. Kinney III   \Changing the mobile computing world/
President and CEO      \          one Linux user         /
Local Net Solutions,LLC \           at a time.          /
770-493-8244             \.___________________________./

GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics) <jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7 



 This is a digitally signed message part




More information about the Ale mailing list