find / grep to list files with php's short_open_tag

David Beveridge dave at bevhost.com
Thu May 9 23:52:01 UTC 2013


>
> [egreshko at meimei try]$ find /tmp/try -type f -name \*.php -exec grep -l -i -n -G "<?$" '{}' \;
> /tmp/try/one.php
>
> --
> The only thing worse than a poorly asked question is a cryptic answer.
>
>
So you want all the <? but not the <?php, <?xml, <?= in text files?

grep -r "<?" * | grep -v "Binary file" | grep -v "<\?php" | grep -v
"<\?xml" | grep -v "<\?="


More information about the users mailing list