Skip to content

Instantly share code, notes, and snippets.

@gagata
Created February 23, 2022 21:46
Show Gist options
  • Save gagata/ef7cb5a8cfb2ecf5cf124f375faadb04 to your computer and use it in GitHub Desktop.
Save gagata/ef7cb5a8cfb2ecf5cf124f375faadb04 to your computer and use it in GitHub Desktop.
sed -E 's/(["\\])/\\\1/g; s/'$'\b''/\\b/g; s/'$'\t''/\\t/g; s/'$'\f''/\\f/g; s/'$'\r''/\\r/g; $!s/$/\\n/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment