[CS-FSLUG] An easy way to remove blank lines?
Josiah Ritchie
jritchie at bible.edu
Mon Sep 12 06:24:53 CDT 2005
On Fri, 2005-09-09 at 21:49 -0400, Brian Derr wrote:
> On Fri, 2005-09-09 at 13:05 -0400, Josiah Ritchie wrote:
> > I'd like to know how to do this is sed. You inspired me to play with it
> > for about 3 minutes. I thought "sed '/^&/d' < temp.text > new.text"
> > should do it, but it didn't touch a thing. Anyone else know that one?
>
> My brain is aching from this one. Running `sed '/^$/d' index.html`
> against a basic HTML file does NOT remove blank lines! Every manual
> I've read and every sed page on the internet says it does just that.
> What gives?
I've managed to get two to work:
sed '/^$/d' < temp.log
sed -n '/^$/!p' < temp.log
JSR/
More information about the Christiansource
mailing list