原始数据:
$ cat data
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
$ cat tdata
This is a joke.
将tdata中的数据插入到data中指定的行后:
$ sed '4r tdata' data
line 1
line 2
line 3
line 4
This is a joke.
line 5
line 6
line 7
line 8
line 9
line 10
$ sed '3,4r tdata' data
line 1
line 2
line 3
This is a joke.
line 4
This is a joke.
line 5
line 6
line 7
line 8
line 9
line 10
$ sed '$r tdata' data
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
This is a joke.
$ sed '/line 1/r tdata' data
line 1
This is a joke.
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
This is a joke.