Skip to content

Instantly share code, notes, and snippets.

@finsterthecat
Created April 14, 2011 15:17
Show Gist options
  • Save finsterthecat/919688 to your computer and use it in GitHub Desktop.
Save finsterthecat/919688 to your computer and use it in GitHub Desktop.
Remove all comment lines. Shows how to invoke ruby as line filter using regex
#Remove all line comments. Backup may be important...
ruby -pi.bak -e '$_.sub!(/^#.*/, "")' /work/test.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment