Artificial intelligent assistant

When using [!set] zsh invokes history expansion When I am searching for a file with ls [a-t]est.txt it gives the result `test.txt` as expected However, when I use ls [!a-g]est.txt output is `ls [aptg]est.txt` Some other examples for [!set]: * `ls [!b-z]est.txt` returns `[bbz]est.txt` * `ls [!g-h]est.txt` returns `ls [git clone --depth=1h]est.txt` Is there something wrong with my zsh, or does [!set] works differently in zsh? * * * Machine is Linux Mint 18.2

One way to avoid history expansion is to quote `!` a backslash:


ls [\!a-g]est.txt


Of course when negating a set it is probably easier to just use `^` instead of `!`.

Another way is to temporarily disable history expansion by adding the character sequence `!"` anywhere (really!) before the (previously) first `!`. `!"` will be removed and any subsequent `!` have no special meaning.


!" ls [!a-g]est.txt
ls !" [!a-g]est.txt
ls [!"!a-g]est.txt
l!"s [!a-g]est.txt

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 4272a76a0a06d7a50fa16686b96079fe