problem with: find command executing a grep
From: j kopek (remove_leading_jgb_jgbjprok_at_optonline.net)
Date: 01/28/04
- Next message: Nils O. Selåsdal: "Re: problem with: find command executing a grep"
- Previous message: Lenard: "Re: GRUB with RH9 / Win2k / WinNT 4?"
- Next in thread: Nils O. Selåsdal: "Re: problem with: find command executing a grep"
- Reply: Nils O. Selåsdal: "Re: problem with: find command executing a grep"
- Reply: Web Surfer: "Re: problem with: find command executing a grep"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 28 Jan 2004 14:26:55 GMT
In another post I stated I am having problems having grep recurse
directories. So I tried a different approach, using the find commmand
with an -exec.
problem:
when I run
find /usr/include -type d -exec grep sometext {}/*.h \;
I am getting:
grep: /usr/include/*.h: No such file or directory
grep: /usr/include/rpcsvc/*.h: No such file or directory
grep: /usr/include/g++-3/*.h: No such file or directory
grep: /usr/include/g++-3/std/*.h: No such file or directory
grep: /usr/include/asm/*.h: No such file or directory
grep: /usr/include/linux/*.h: No such file or directory
grep: /usr/include/linux/byteorder/*.h: No such file or directory
grep: /usr/include/linux/isdn/*.h: No such file or directory
grep: /usr/include/linux/lockd/*.h: No such file or directory
grep: /usr/include/linux/mtd/*.h: No such file or directory
grep: /usr/include/linux/netfilter_ipv4/*.h: No such file or directory
grep: /usr/include/linux/netfilter_ipv6/*.h: No such file or directory
grep: /usr/include/linux/nfsd/*.h: No such file or directory
grep: /usr/include/linux/raid/*.h: No such file or directory
grep: /usr/include/linux/sunrpc/*.h: No such file or directory
grep: /usr/include/arpa/*.h: No such file or directory
grep: /usr/include/bits/*.h: No such file or directory
grep: /usr/include/gnu/*.h: No such file or directory
grep: /usr/include/net/*.h: No such file or directory
grep: /usr/include/netash/*.h: No such file or directory
grep: /usr/include/netatalk/*.h: No such file or directory
grep: /usr/include/netax25/*.h: No such file or directory
grep: /usr/include/neteconet/*.h: No such file or directory
grep: /usr/include/netinet/*.h: No such file or directory
grep: /usr/include/netipx/*.h: No such file or directory
grep: /usr/include/netpacket/*.h: No such file or directory
grep: /usr/include/netrom/*.h: No such file or directory
grep: /usr/include/netrose/*.h: No such file or directory
grep: /usr/include/nfs/*.h: No such file or directory
grep: /usr/include/protocols/*.h: No such file or directory
grep: /usr/include/rpc/*.h: No such file or directory
and so on
and so on
I have also tried
-exec {}/*.* \;
-exec {} \;
I finally got the result I wanted by using:
for dir in `find -/usr/include -type d`
do
grep sometext $dir
done 2>/dev/null
So....
what am I doing wrong?
thank you for your help
john
- Next message: Nils O. Selåsdal: "Re: problem with: find command executing a grep"
- Previous message: Lenard: "Re: GRUB with RH9 / Win2k / WinNT 4?"
- Next in thread: Nils O. Selåsdal: "Re: problem with: find command executing a grep"
- Reply: Nils O. Selåsdal: "Re: problem with: find command executing a grep"
- Reply: Web Surfer: "Re: problem with: find command executing a grep"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]