我有以下文件
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>/usr/local/texlive/2017/texmf-dist/fonts/opentype</dir>
<dir>/usr/local/texlive/2017/texmf-dist/fonts/truetype</dir>
<dir>/usr/local/texlive/2017/texmf-dist/fonts/type1</dir>
</fontconfig>
Run Code Online (Sandbox Code Playgroud)
我必须添加以下几行:
<dir>/usr/local/texlive/texmf-local</dir>
<dir>/usr/local/share/fonts</dir>
Run Code Online (Sandbox Code Playgroud)
在结束标记 /fontconfig> 之前。我不确定它是否总是在第 7 行,所以我必须将它作为一个字符串来查找。我在使用 <> 和 / 的这些字符串中遇到了一些麻烦……我如何用 sed 解决?谢谢