Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ID 1
- blah blah
- blah blah
- $ description 1
- blah blah
- # ID 2
- blah
- $ description 2
- blah blah
- blah blah
- # ID 1
- $ description 1
- blah blah
- # ID 2
- $ description 2
- blah blah
- blah blah
- sed '/^#/,/^$/{/^#/!{/^$/!d}}' file.txt
- # ID 1
- $ description 1
- blah blah
- # ID 2
- $ description 2
- blah blah
- blah blah
- $ cat test
- 1
- start
- 2
- end
- 3
- $ sed -n '1,/start/p;/end/,$p' test
- 1
- start
- end
- 3
- $ sed '/start/,/end/d' test
- 1
- 3
- sed -n -e "1,/# ID 1/ p" -e "/$ description 1/,$ p"
- sed '/^#/,/^$/{//!d;};' file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement