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

Re: Quoting the arguments to a function



On Thu, 2016-09-15 at 14:41 -0700, zv wrote:
> I want to supply the arguments of a function (an alias to Emacs `calc') without expansion, e.g:
> 
> 	zv@computer# calc 20/2*15
> 	150
> 
> 
> Today of course the result gives "zsh: no matches found: 20*15/2"
> 
> Is there any way to signal to ZSH that an alias or fn should have arguments supplied literally?

Well, not exactly, you can turn off globbing with:
  alias calc='noglob calc'

But that won't work for:
  % calc 0xff&0x80
still would be parsed as:
  % calc 0xff &
  % 0x80

Phil.



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