Why can't I sed two [or more..] empty lines to one empty line? What is the trick?
echo -e "hello\n\n\nhello2" | sed 's/^$\n^$/\n/g'
hello
hello2
|
Why can't I sed two [or more..] empty lines to one empty line? What is the trick?
| ||||
|
feedback
|
|
The reason your The easist way to collapse multiple blank lines is with
It works like this:
If you want to remove the blank lines entirely rather than compressing them, use
Note that if you really want to do this in
You can see why | |||||||||||||
feedback
|