sed行前添加文件

2025-03-24 21:16:45
推荐回答(1个)
回答1:

zoer@ubuntu:~/aa$ cat data  
here is a   
test naughty loves cc  
and so on....  
  
zoer@ubuntu:~/aa$ cat dd  
testline1  
testline2  
zoer@ubuntu:~/aa$ sed '/naughty/r dd' data  
here is a   
test naughty loves cc  
testline1  
testline2  
and so on....

使用r就可以了,你仿照上面的试试