【发布时间】:2012-05-11 21:03:33
【问题描述】:
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 的匹配模式?我试过用“我”,没有运气。这应该很快,谢谢大家!
【问题讨论】: