Artificial intelligent assistant

grep fails looking for string I don't understan why grep doesn't work in the first example bla@ble:~/html/example$ grep -r "protected $disallowedBlockNames = array('install/end');" app/ bla@ble:~/html/example$ But bla@ble:~/html/example$ grep -r 'protected $disallowedBlockNames = array' app/ app/Resource/Block.php: protected $disallowedBlockNames = array('install/end');

You didn't provide sample input but in your first example your double quotes are allowing the `disallowedBlockNames` variable to be expanded by your shell _before_ it is used by `grep`. I'm assuming this is a variable set in your php code and does not exist in your shell and therefore it is expanding to nothing. So what you are really sending to grep is:


grep -r "protected = array('install/end');" app/


In the second example the single quotes prevent the shell from expanding the variable.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 7e5801d543cc8259f4493efa4edad3a4