Created
March 10, 2011 08:59
-
-
Save kiltec/863789 to your computer and use it in GitHub Desktop.
Fix else-statements in C like languages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This command converts: | |
# } | |
# else { | |
# echo $bleh; | |
# } | |
# | |
# to: | |
# } else { | |
# echo $bleh; | |
# } | |
# | |
# Don't remove the line break after the "{N" otherwise it won't work. | |
find . -name "*.php" -exec sed '/}$/ {N | |
s/\}\n[\t]*else/\} else/ }' {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment