“Event not found” error for shell command in unix [duplicate]

ε祈祈猫儿з 提交于 2019-11-26 17:12:21

问题


when i am trying to remove consecutive duplicate lines with

awk "!x[$0]++" file

its reporting x[: Event not found.

even the same case with

sed -i -e "$!N; /^\(.*\)\n\1$/!P;D" file as well reporting

N: Event not found. i tried with single quotes too, it didn't help

Any idea to fix those


回答1:


You're invoking the shell's history substitution. Surround the exclamation point with single quotes.



来源:https://stackoverflow.com/questions/10221835/event-not-found-error-for-shell-command-in-unix

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!