The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 02-06-2002
jo_aze jo_aze is offline
Registered User
 

Join Date: Feb 2002
Location: PARIS (FRANCE)
Posts: 22
Thank to be indulgent about my english ...
Yours suggestions and remarks are correct and i noticed that precisions miss so:

My complete problem is that i'm trying to set up a method (using find command for example) to filter all directories and sub-directories containing a predefined substring (like "toto") declared in a variable (because of a loop. see above for details).

I try first to implement find command with "-exec" option and combine it with grep command:
find . -type d -exec grep ... ... {} \;
But it seems not to be the good way.

...

While writting this reply, i thought about another way of solution. Perhaps have you any suggestions to improve and validate it:

find . -type d -exec basename {} \; -ls | grep -i "toto" | nawk '{print 11}'