Am 09.05.2013 05:53, schrieb Patrick O'Callaghan:
On Tue, 2013-05-07 at 19:41 +0200, Reindl Harald wrote:
find /data/www/ -type f -name *.php -exec grep -l -i -n -F "<?" '{}' ; lists any file which contains "<?" under the path /data/www/
find /data/www/ -type f -name *.php -exec grep -l -i -n -F "<?\n" '{}' ; is expected to find any file with "<?" followed directly by a linebreak but that does not work and if someone finds google empty it was me :-(
Not sure if "\n" is allowed, but why not use $ for end of line as in most regular expressions?
because it does not work and i have no idea how to "mask" the LF for grep
[harry@srv-rhsoft:~]$ find /mnt/data/www/ -type f -name *.php -exec grep -l -i -n -F "<?$" '{}' ; [harry@srv-rhsoft:~]$
as you see nothing found
[harry@srv-rhsoft:~]$ cat /mnt/data/www/short-open.php <? echo 'TEST'; ?>
as you see there is at least one file