题目内容

对文件 hello.txt,把从包含"you"的行开始一直到文件结尾整个替换为"\nHave a nice day"$ sed -e '_______________________' hello.txtHello WorldHave a nice day

查看答案
更多问题

把所有偶数行替换为---seq 5 | sed '__________'1---3---5

在文件foo.txt的每两行之后添加来自文件address.txt的一行内容$ cat foo.txtbla bla 2015 blablah 2018 blahbla bla blacopyright: 2020$ cat address.txtstart address: 0xA0, func1 address: 0xA0end address: 0xFF, func2 address: 0xB0$ sed -n 'p' address.txt | sed -e '________________' foo.txtbla bla 2015 blablah 2018 blahstart address: 0xA0, func1 address: 0xA0bla bla blacopyright: 2020end address: 0xFF, func2 address: 0xB0

在文件address.txt的每一行前插入一行"---",并且在其后添加来自文件map.txt的一行。$ cat map.txt0xA0 0x50000xB0 0x60000xFF 0x7000$ sed ___________________ address.txt---start address: 0xA0, func1 address: 0xA00xA0 0x5000---end address: 0xFF, func2 address: 0xB00xB0 0x6000

文件hello.txt的内容如下:$ cat hello.txtHello WorldHow are youThis game is goodToday is sunny12345You are funny请用sed对该文件做如下处理:如果某行包含"e",则把所有连续的重复字符变成大写并用{}括起来如果某行不包含"e",但包含"u"则将该行所有大写字母用[]括起来# 注意:第二行的H和最后一行的Y没有被修改$ sed -r '_____________________________________' hello.txtHe{LL}o WorldHow are youThis game is g{OO}d[T]oday is sunny12345You are fu{NN}y

答案查题题库