linux - Using grep to find function -


i need find usage of functions system("rm filename") & system("rm -r filename").

i tried grep -r --include=*.{cc,h} "system" . & grep -r --include=*.{cc,h} "rm" . giving many outcomes.

how search instances of system("rm x") 'x' can anything. kind of new grep.

try:

grep -e "system\(\"rm [a-za-z0-9 ]*\"\)" file.txt 

regexp [a-za-z0-9 ] builds pattern grep needs find in x of system("rm x"). unfortunately, grep don't supports groups matching, need specify directly search.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -