perl -ne "/(?s)<\?php.+?[\\$]{1}/ and exit 0; exit 1" filename.txt ; echo $?