I've been using zsh and ohmyz.sh for years, but I still occasionally forget this shell interprets square brackets as a pattern on the command line. Two improvements on the default behavior.
I've been using zsh and ohmyz.sh for years, but I still occasionally forget this shell interprets square brackets as a pattern on the command line.
Here's an example:
$ which $SHELL
/usr/bin/zsh
$ pip install -e .[develop,plugins]
zsh: no matches found: [develop,plugins]
Instead of installing the develop
and plugins
variant of this Python package, zsh attempted to match this pattern. To account for this, I need to escape the square brackets:
$ pip install -e .\[develop,plugins\]
Obtaining file:///home/leigh/projects/OctoPrint
If I need a more permanent fix, I can use an alias to set -o noglob
(disable shell globbing) for a command is run by adding this to my .zshrc
file:
alias pip='noglob pip'