我想在使用sed的文件中的最后一行之前插入多行,使用下面的sed attr
> sed -i '/\/web-app/r web.xml' inputerror.txt文件中的最后一行
</web-app>inputerror.txt内容如下
<error-page>
<error-code>404</error-code>
<location>/web/404</location>
</error-page>我的web.xml中没有添加任何建议
发布于 2015-10-08 21:17:17
在GNU sed中进行了以下工作:
sed '$s@^@<error-page>\n <error-code>404</error-code>\n <location>/web/404</location>\n</error-page>\n@' web.xml但我不知道\n有多便携,也不知道如何从文件中读取它。
https://stackoverflow.com/questions/33008715
复制相似问题