here is the input:
aaa
bbb
ccc
ddd
eee
fff
what I want? do sth like” sed “/ccc/,/(eee)/d” BUT ALSO DELETE “bbb” line (before “ccc”)
so that output is:
aaa
fff
any ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are fine with awk, this should do:
Every previous line is printed in the above case. Normal range filtering is done using awk. However, within the range filter, the variable x is reset so that the previous record just before the range is not printed.
Update:
sed solution: