Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Problem with "?" symbol


On 2010-08-03 15:26:30 +0300, Volodya Khomchak wrote:
> I faced with next issue in zsh. I'm new with this and don't have any
> idea why this occurs.
> So the problem is next:
> [kolombo:~]> curl -vvv -k https://HOST.COM/page/page2/?virtual_serial=101032
> zsh: no matches found:
> https://esx16-bsd05.qa.sbr.ironport.com/atlas/ipcs/?virtual_serial=101032
> This command fails on "?" symbol, do you have any idea why  this occurs ?

The ? is a special character for the shell (which cannot know
whether the argument is a filename or not). There are 2 solutions:

1. Quote the character manually, e.g.

     cmd foo\?bar


     cmd "foo?bar"

2. Quote the character automatically:

     autoload -Uz url-quote-magic
     zle -N self-insert url-quote-magic

   in your ".zshrc".

Note: solution (2) is only a heuristic, which works well in practice,
but may need more configuration in specific cases.

> Also I know that this could be resolved by this:
> alias curl="noglob curl"

Not necessarily a good solution, as curl also works with filename

Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)

Messages sorted by: Reverse Date, Date, Thread, Author