我需要从大约 1.5k 个文件中删除或注释掉以下内容,并且在执行此操作时遇到了很多麻烦。我已经用 perl find/replace 尝试了所有我能想到的东西,但没有得到任何结果。任何有关方法的建议都会有所帮助。它上方和下方的选项卡包含针对每个 xml 分支更改的属性,因此我不能使用它们来查找/替换。我已经尝试了我能想到的每一种组合,但没有得到任何结果。当我尝试查找/替换*
's 的字符串时,我收到一个错误,指出参数列表太长。如果我尝试在空白行和 1 上查找/替换*
,它也不会捡起它。几个例子:
perl -pi -e 's/\n\*/<!--/g' */*/*.log
perl -pi -e 's/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/<!--/g' */*/*/log
perl -pi -e 's/>\n\*/><!--/'g */*/*.log (this one tries finding the end of the tag above it)
******************************************************
This system is for the use of authorized users only.
Individuals using this computer system without
authority, or in excess of their authority, are
subject to having all of their activities on this
system monitored and recorded by system personnel.
In the course of monitoring individuals improperly
using this system, or in the course of system
maintenance, the activities of authorized users may
also be monitored.
Anyone using this system expressly consents to such
monitoring and is advised that if such monitoring
reveals possible evidence of criminal activity, system
personnel may provide the evidence of such monitoring
to law enforcement officials.
******************************************************