I'm trying to find instances of $
which are not followed by !
.
That should necessitate $
, escaped, which is \\$
and [^!]
escaped which should be [^\\!]
unless the [
and ]
need to be escaped as well? Not sure about this one - don't know enough about bash just yet.
ag "\\$[^\!]"
bash: ^\!: syntax error: operand expected (error token is "^\!")
ag "\\$[^!]"
bash: !]: event not found
ag "\\$[^\\!]"
bash: ^\\!: syntax error: operand expected (error token is "^\\!")
ag "\\$[\\^\\!]"
bash: \\^\\!: syntax error: operand expected (error token is "\\^\\!")
ag "\\$[\^\!]"
bash: \^\!: syntax error: operand expected (error token is "\^\!")
These produce no results:
ag "\\$\\[\\^\\!\\]"
ag "\\$\\[\\^\\!\\]"
ag "\\$\[\\^\\!\]"
ag "\\$\[\^\!\]"
ag "\$\[\^\!\]"
ag "\\$\[\^\!\]"