Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oh-my-zsh hash (pound) symbol bad pattern or match not found

Tags:

key

hash

zsh

I'm quite sure is something dealing with my Oh-my-zsh configuration, but I can't figure out what it is.

When I use a "#" symbol in my git command (but on everything else too, like 'ls #2' for instance) I get 'bad pattern' error or 'no match found'

I guess is about counting something, but I can't find where to configure it.

I.E.

➜  demo git:(adlist) git push origin adlist#3 
zsh: no matches found: adlist#3

or

➜  demo git:(adlist) git push origin #3-adlist
zsh: bad pattern: #3-adlist
like image 463
adedip Avatar asked Sep 06 '12 15:09

adedip


2 Answers

Use single quotes:

git push origin 'adlist#3'
git push origin #3-adlist

In zsh # is used for pattern removal. See: http://zsh.sourceforge.net/Guide/zshguide05.html under the heading Standard forms: pattern removal

like image 180
Steve McKinney Avatar answered Jan 04 '23 00:01

Steve McKinney


You can unsetopt EXTENDED_GLOB, and this should stop # being interpreted as a part of a pattern.

If you really want to keep most of the features of EXTENDED_GLOB, but want to disable # being used for patterns, then you can disable -p '#' (you have to single quote the # argument, so that it doesn't get expanded like a pattern). This certainly works in my zsh installation, version 5.7.1, even though it is not documented in zshbuiltins(1).

like image 42
Sam Elliott Avatar answered Jan 03 '23 23:01

Sam Elliott