Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 279
user1228191 Avatar asked Apr 19 '12 04:04

user1228191


1 Answers

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

like image 93
Ignacio Vazquez-Abrams Avatar answered Oct 06 '22 10:10

Ignacio Vazquez-Abrams