Artificial intelligent assistant

Event not found in shell expansion $ touch fux fax fix $ ls f[!a]x zsh: event not found: a]x I want to see fix and fux as output, but not fax. I want to know the exact reason behind this issue. Is this particular issue regarding the code or not?

Comments from OP have explained that they are looking to match all files OTHER than `fax`.

This can be fixed with `shopt -s extglob` (See Exclude one pattern from glob match)


$ touch fix fax fux
$ shopt -s extglob
$ ls f!(a)x
fix fux


Alternate answer from Giles (comment below) that does not require `extglob` to be set:


$ ls f[^a]x
fix fux


My original answer text is below. This answer was written under the assumption he was attempting to use an exclamation point in his answer. After learning from what was stated in OP's comment on my answer, I have reviewed it and added the answer he was looking for above.

The `!` represents a history lookup. See Can't use exclamation mark (!) in bash? Your shell will look for the last command that started with:


a]x


But there is not a command that starts with `a]x`.

Try escaping the exclamation point:


$ touch fix fax fux
$ ls f[\!a]x
fix fux

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy a6d02ac2d98be05462a9620fec95289f