- 论坛徽章:
- 780
|
回复 11# blackold
。。。黑哥威武啊,我试了下我和星辰的代码,
545 Taylor Swift这一行都没正确输出。。。- [masonzhu@rat122 zzz]$ sed -n '/Title/,+1p' i
- Justin Timberlake, Title
- Another: Justin Timberlake, Title
- 723Mick Jagger, Title
- 610Lady Gaga
- [masonzhu@rat122 zzz]$ sed -n '/Title/{N;p}' i
- Justin Timberlake, Title
- Another: Justin Timberlake, Title
- 723Mick Jagger, Title
- 610Lady Gaga
- cat i
- Let's assume that you have a large log file
- called log which contains thousands of lines
- Justin Timberlake, Title
- Another: Justin Timberlake, Title
- 545 Taylor Swift
- The sed equivalent would be
- 723Mick Jagger, Title
- 610Lady Gaga
复制代码 |
|