Perl oneline 命令错误
perl -pi -e 's|\x20|; s|\x90|' log.bin
给我这个错误
Backslash found where operator expected at -e line 1, near "s|\x20|; s|\"
syntax error at -e line 1, near "s|\x20|; s|\"
Execution of -e aborted due to compilation errors.
我做错了什么?该行旨在用 0x20 到 0x90 替换所有字节...
perl -pi -e 's|\x20|; s|\x90|' log.bin
gives me this error
Backslash found where operator expected at -e line 1, near "s|\x20|; s|\"
syntax error at -e line 1, near "s|\x20|; s|\"
Execution of -e aborted due to compilation errors.
What am I doing wrong? the line intended to replace all bytes with 0x20 to 0x90...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你有 2 个半陈述,而不是一个完整的陈述。您可能正在寻找
You have 2 half statements, instead of one complete one. You're probably looking for
该命令中有两个不完整的替换,您说替换
\x20
而不指定应该替换什么,然后再次单独说替换\x90
省略替换。这是一个语法错误。正确的语法是
you have two incomplete substitutions in that command, you say substitute
\x20
without specifying what it should be replaced with, then separately say replace\x90
again omitting the replacement. This is a syntax error.the correct syntax is
您的 s 命令格式错误。试试这个:
g 表示全局,并且命令需要格式化
You formatted the s command wrong. Try this:
The g means global and the formatting is necessary for the command