Skip to content

Instantly share code, notes, and snippets.

@sylr
Created March 29, 2010 16:27
Show Gist options
  • Save sylr/348054 to your computer and use it in GitHub Desktop.
Save sylr/348054 to your computer and use it in GitHub Desktop.
perl command lines
# trim lines containing only spaces or tabs
perl -pi -e "s/^(\s+|\t+)$/\n/i" *
# remove duplicate empty lines
perl -i -0777 -pe "s/^([^\n]+)\n+$/\$1\n/mg" *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment