我有一個html文件的目錄,我想在其中刪除所有內容(包括)匹配的表達式。我已經試過我找的這個(其中字符串XXXXXX我們:Perl或Sed命令在匹配表達式之前刪除內容
perl -pi -e "$a++if s/.*XXXXXX.*//si;$a||s/.*//s" *.html
我收到此錯誤(在那裏,當我按下回車鍵,正在改變我的命令,請參見第一行):
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的命令任何幫助使用?
你使用哪個操作系統? – 2013-02-12 22:08:50