How to stop zsh from expanding * (asterisk) in command line?

zsh

Solution

You can do:

noglob echo 2*3 | bc

And then create an alias around this:

calc()
{
   echo $* | bc
}
alias calc='noglob calc'

Problem

I recently switched to `zsh`. When I was using `bash`, I used to use `echo 2*3 |bc` as a powerful and convenient calculator but in `zsh` the first part of the command result in error message: ``` $ echo 2*3 zsh: no matches found: 2*3 ``` I know I can avoid the expansion by adding quote to the string `2*3` but is it possible to bring this feature from `bash` (not expanding asterisk in command argument)? UPDATE: In the meaning while I found `bc <<< 2*3` won't trigger the expansion, weird :-(

Original source