sed的两种添加多行文本方法
方法一:
[root@localhost ~]# cat a.sed
Zhang San
Li Si
[root@localhost ~]# cat test
What is your name
how are you
[root@localhost ~]# sed '$r a.sed' test
What is your name
how are you
Zhang San
Li Si
方法二:
[root@localhost ~]# cat b.sed
$a\
Zhang San\
Li Si
[root@localhost ~]# cat test
What is your name
how are you
[root@localhost ~]# sed -f b.sed test
What is your name
how are you
Zhang San
Li Si

浙公网安备 33010602011771号