我想请教一下如何把指定两行之间的内容放到另一个文件里的指定行的后面并在下一行增加结尾呢?
例如我有三个文件,其中前两个文件的内容为:
Never give up,
Never lose hope.
Always have faith,
It allows you to cope.
Trying times will pass,
As they always do.
Just have patience,
Your dreams will come true.
永不放弃
永不心灰意冷
永存信念
它会使你应付自如
而我想实现如第三个文件的效果,即把第二个文件中间的两行放到第一个文件的最后面并在下一行加三个感叹号:
Never give up,
Never lose hope.
Always have faith,
It allows you to cope.
Trying times will pass,
As they always do.
Just have patience,
Your dreams will come true.
永不心灰意冷
永存信念
!!!
这种应该如何用Linux语句实现呢,我初步设想用sed语句实现,奈何知识薄弱,希望各位不吝赐教。