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
Post a Comment