Nov 2, 2020 1 min read

zsh: no matches found

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'
zsh

Join the conversation

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Bitsy.ai.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.