Skip to content

Instantly share code, notes, and snippets.

@dfarrell-bloom
Created April 24, 2014 14:00
Show Gist options
  • Save dfarrell-bloom/11255657 to your computer and use it in GitHub Desktop.
Save dfarrell-bloom/11255657 to your computer and use it in GitHub Desktop.
Ruby replace newlines with '\n'
ruby -e 'puts $stdin.lines.map{ |l| l.gsub("\n","\\n") }.join ""'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment