任何人都可以帮我弄清楚如何做到这一点,我将不胜感激.
例
block of //delete
non-important text //delete
important text //keep
more important text //keep
Run Code Online (Sandbox Code Playgroud)
Sie*_*geX 10
sed '1,/^$/d' file
Run Code Online (Sandbox Code Playgroud)
要么
awk '!$0{f=1;next}f{print}' file
Run Code Online (Sandbox Code Playgroud)
$ sed '1,/^$/d' <<< $'block of\nnon-important text\n\nimportant text\nmore important text'
important text
more important text
$ awk '!$0{f=1;next}f{print}' <<< $'block of\nnon-important text\n\nimportant text\nmore important text'
important text
more important text
Run Code Online (Sandbox Code Playgroud)