Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想删除以<Field name="LastDate"xml 文件开头的行。
<Field name="LastDate"
这个空间似乎在这里制造了问题sed -i /^<Field name="LastDate"/d test.xml。我该怎么做?
sed -i /^<Field name="LastDate"/d test.xml
您需要引用脚本(单引号,因为文本已经包含双引号):
$ sed -i '/^<Field name="LastDate"/d' test.xml