Event not found error for shell command in unix

when i try 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 , telling

N: Event not found. I also tried with single quotes, this did not help

Any idea to fix these

+8
unix shell awk tcsh sed
source share
1 answer

You invoke a shell history replacement. There are single quotation marks around the exclamation mark.

+16
source share

All Articles