简体   繁体   中英

OSX : list files that contains Author:XXXX then grep them to find how many methods they have

I am trying to come up with script that will find how many methods/functions are in files written by specific developers.

For example I want to filter down files that contains Author:XXXXXX then I want to search them to see how many instances the contain -(void)test (count the lines that start with or list the lines)

Thanks

One possible solution:

for F in $(grep -l Author *.txt); do echo $F; grep -c void $F; done

You might want to put some quote marks in various places to protect the file names from expansion...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM