我有一个 html 文件目录,我想在其中删除所有内容(包括)匹配的表达式。我已经尝试过了(其中 XXXXXX 是我要查找的字符串:
perl -pi -e "$a++if s/.*XXXXXX.*//si;$a||s/.*//s" *.html
我收到此错误(当我按 Enter 时,它正在更改我的命令,请参见第一行):
perl -pi -e "$a=1 if *.htmla && s/.*XXXXXX.*//is; s/.*//s if *.htmla" *.html
Bareword found where operator expected at -e line 1, near "*.htmla"
(Missing operator before htmla?)
Bareword found where operator expected at -e line 1, near "*.htmla"
(Missing operator before htmla?)
syntax error at -e line 1, near "="
syntax error at -e line 1, near "*.htmla
"
Execution of -e aborted due to compilation errors.
使用 Perl 命令有什么帮助吗?