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' |
That’s so ugly though, isn’t it! When I realised it would look like that, I ran looking for another solution. I found one.
echo -e “Line containing nnewlines!” | tr -d “n”
Ah sorry, I see it mentions that one too. Not sure why you’d still want to use sed!