Created
July 15, 2011 15:52
-
-
Save evandrix/1084944 to your computer and use it in GitHub Desktop.
Perls of wisdom
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
# Add line numbers to file | |
cat file | perl -wne 'while (<STDIN>) { print "$. $_" }' | |
# Add '!' prefix for WikiFormatting of classnames | |
# pattern: | |
# - 2 or more capital letters | |
# - no consecutive capital letters | |
# or use {{{ ... }}} for preformatted code block | |
cat file | grep -v "^\s*$" | sed -e "s/$/ [[br]]/g" | perl -wne '$_ =~ s/(?!\w*[A-Z]{2,}\w*)((?<!")[A-Z]\w+[A-Z]\w+)/!$1/g; print;' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment