<key name='notify-on-connect' type='b'>
<summary>Notify on connect</summary>
<description>
If true, show a notification when a user connects to the system.
</description>
<default>true</default>
</key>
</schema>
</schemalist>
现在我想在倒数第三行开始插入一段内容,插入后如下所示:
<key name='notify-on-connect' type='b'>
<summary>Notify on connect</summary>
<description>
If true, show a notification when a user connects to the system.
</description>
<default>true</default>
</key>
<key name=’enabled’ type=’b’>
<summary>Enable remote access to the desktop</summary>
<description>
If true, allows remote access to the desktop via the RFB
protocol. Users on remote machines may then connect to the
desktop using a VNC viewer.
</description>
<default>false</default>
</key>
</schema>
</schemalist>
上面红色是我插入的内容,请问我如果要实现这种插入,shell脚本应该如何来写?在指定的位置插入一段内容,并且这一段内容,每一行前面的空格也是固定的,
像上图中红框中的第一行 <key name=’enabled’ type=’b’>,前面有4个空格。而第二行 <summary>Enable remote access to the desktop</summary>,前面有6个空格。我应该如何写脚本达到这种效果。 作者: wh7211 时间: 2021-05-27 17:14 回复 1# 274920831
cat 1
<key name='notify-on-connect' type='b'>
<summary>Notify on connect</summary>
<description>
If true, show a notification when a user connects to the system.
</description>
<default>true</default>
</key>
</schema>
</schemalist>
cat 2
<key name=’enabled’ type=’b’>
<summary>Enable remote access to the desktop</summary>
<description>
If true, allows remote access to the desktop via the RFB
protocol. Users on remote machines may then connect to the