onirix
onirix

Reputation: 335

Why theses both egrep search don’t return the same result?

I’d like to understand why with the include parameter it doesn’t search into the file identification.php that were targeted.


With the include parameter :

admin@server:/filer/www/website/httpdocs$ egrep -Rns --include=*.php "deleteTemp" *
identification.php-sed:61:  $deleteTemp = " DELETE FROM ".$table_name."
identification.php-sed:64:  $execTemp   = @mysql_query ( $deleteTemp );

And without :

admin@server:/filer/www/website/httpdocs$ egrep -Rns "deleteTemp" *
identification.php:61:  $deleteTemp = " DELETE FROM ".$table_name."
identification.php:64:  $execTemp   = @mysql_query ( $deleteTemp );
identification.php-sed:61:  $deleteTemp = " DELETE FROM ".$table_name."
identification.php-sed:64:  $execTemp   = @mysql_query ( $deleteTemp );

I also tried with quotes for the pattern of the include and the result is the same.

Upvotes: 0

Views: 38

Answers (1)

bufh
bufh

Reputation: 3420

I think it is because your pattern is being interpreted by the shell, try:

egrep -Rns --include=\*.php "deleteTemp" *

By the way, do you know ag?

Upvotes: 0

Related Questions