我需要添加一个文本字符串:
--with-mpm=event \
位于138位置的是httpd.spec
。
我尝试过:
sed -i '138i--with-mpm=event \\' /root/rpmbuild/SPECS/httpd.spec
这段代码在虚拟机引导过程中的 Vagrantfile 的 bash 脚本中运行。然而,该脚本返回错误。
当我检查 httpd.spec 时,输出的字符串缺少反斜杠。
--with-mpm=event
尽管在虚拟机的shell中直接运行它可以正常工作。
我如何使用sed
修复它?
谢谢!
\\\
?\\\\
? - Wiktor Stribiżew