The follow grep command returns ZERO matches:
grep -Filr "$dif_refund[0]->{ $a[" /var/www/html/
However, if I just remove the square bracket, several matching filenames are returned:
grep -Filr "$dif_refund[0]->{ $a" /var/www/html/
How can I make my search work with square brackets without using a regular expression?
CodePudding user response:
Just replace your double-quotes w/ single-quotes.
The problem is not the square bracket, the problem is the $a
grep -Filr '$dif_refund[0]->{ $a[' /var/www/html/