“Event not found” error for shell command in unix

2020-01-29 14:28发布

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条回答
▲ chillily
2楼-- · 2020-01-29 15:06

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

查看更多
登录 后发表回答