sed help needed

Archaic archaic at linuxfromscratch.org
Mon Feb 14 07:07:49 PST 2005


I have a situation where I need to remove everything between lines a and
b (and remove line b) and then uncomment everything between lines b and
c (and uncomment line c. I've been wrestling with this for awhile and
apparently I'm just not grokking the sed expression. Here's an example:

-----------------original------------------
# This is the first line (line a)
foo
bar
foobar
# This is the second line (line b)
# foobaz
# quux
# barfoo
# # This is the third line (line c)
-------------------------------------------

-----------------modified------------------
foobaz
quuz
barfoo
# This is the third line (line c)
-------------------------------------------

Any suggestions?

-- 
Archaic

Want control, education, and security from your operating system?
Hardened Linux From Scratch
http://www.linuxfromscratch.org/hlfs




More information about the lfs-chat mailing list