Re: to remove leading and trailing blank lines

Jim Hill <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <CAEE75_2s4vnrQAB1sahr-+aCcN76PV91X7tf=orD=v9c0fbvDQ@mail.gmail.com>
I figure buffering's too cheap to meter, so I like this one:

    sed 'H;$!d;g; s/\n*$//; s/^\n*//'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.