Search code examples
linuxcommand-lineack

Ack & negative lookahead giving errors


I have a problem with using ack-grep with a negative look ahead.

I am running this command:

ack-grep "paypal_responded(?!_at)"

but I am getting the error:

bash: !_at: event not found

I have tried adding backslashes in various places, but I'm also new to using ack & linux, so please treat me as a newbie with any instructions.

Thanks in advance.


Solution

  • Try ack-grep 'paypal_responded(?!_at)'

    You need single-quote to avoid bash interpret ! as history expand command.