bug-grep
[Top][All Lists]
Advanced

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

Re: using grep inside 2 levels of directory


From: Venkatesan Jeevanandam
Subject: Re: using grep inside 2 levels of directory
Date: Fri, 23 May 2008 00:56:09 -0700 (PDT)

Hi Bob,
Thanks for your reply.

I used the command the way you specified, but I am getting the below error.
/tools/oss/packages/x86_64-rhel4/findutils/default/bin/find: missing
argument to `-exec'

Thanks,
Venkat.


Bob Proulx wrote:
> 
> Venkatesan Jeevanandam wrote:
>> I have to grep for "text" inside a directory for files "*.soc".
>> ...
>> I want to search for "text" using grep command for all *.soc files in all
>> "arch*/core*" folders.
>> I tried like this, but it doesnt help me.
>> 
>> $pwd
>> /home/venkat/project
>> $grep */*/*soc (not working)
> 
> I don't see a pattern there.  In which case grep will use the first
> expanded filename as the pattern.  Perhaps you meant to use this:
> 
>   grep PATTERN */*/*soc
> 
>> I want to grep in files like, using one command.
>> arch1/core1/*.soc
>> arch1/core2/*soc
>> arch1/core3/*soc
>> arch2/core1/*soc
> 
> I would use find rather than the shell to select the files and then
> have find call grep.
> 
>   find . -name "*.soc" -exec grep PATTERN {} +
> 
> Bob
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/using-grep-inside-2-levels-of-directory-tp17402549p17420478.html
Sent from the Gnu - Grep mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]