Created
January 9, 2014 12:30
-
-
Save coderofsalvation/8333389 to your computer and use it in GitHub Desktop.
replaces newlines (enters) in string with given parameter
This file contains hidden or 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
| # replaces newlines (enters) in string with given parameter | |
| # usage: cat file.txt | replacenewlines "," | |
| replacenewlines(){ | |
| cat - | sed ':a;N;$!ba;s/\n/"$1"/g' | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment