Skip to content

Instantly share code, notes, and snippets.

@augustohp
Created April 17, 2012 18:03
Show Gist options
  • Save augustohp/2407874 to your computer and use it in GitHub Desktop.
Save augustohp/2407874 to your computer and use it in GitHub Desktop.
Fix short open tags
# Gets all the files that has short_open_tags for PHP in the currently directory (recursively)
for filename in `grep -r '<? ' . | grep -v '.git' | cut -d : -f 1 | sort | uniq` then
# Changes all short_open_tags in the file to <?php
sed 's/<\? /<\?php /g' $filename > /tmp/a && mv /tmp/a $filename
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment