test.txt
Welcome notice
------------------------
Hello there, welcome! Foo
hello
world
Bar
Yes!
Foo
How are ya?!
Bar
Have a great day!
sed - 抓取文本
$ sed -n '/Foo/,/Bar/p' test.txt
输出
Hello there, welcome! Foo
hello
world
Bar
Foo
How are ya?!
Bar
如何使此处不区分大小写?例如,'FOO'或'bAr'将匹配sed的匹配模式?我尝试使用'I',但没有成功。这应该很快就能解决,谢谢!