Archive

Archive for June 24th, 2008

Removing newlines (\n) with sed

June 24th, 2008

Today I had to search again on how to remove newline special characters with sed. Thanks to Kamil over at linux.dsplabs.com.au, I found it again rather quickly.

Now, this is just for my own safekeeping, so I don’t end up googling for it again … *shrug*

1
echo -e "Line containing \nnewlines!" | sed ':a;N;$!ba;s/\n//g'

Life ,