4
1
I am using zsh, and I am trying to use python as a simple calculator. I'm very familiar with python, but can't seem to get the alias (or function) to work properly.
So far I've got:
pycalc() {
python -c "print '$@'"
}
alias p=pycalc
No matter what I do, it returns zsh: no matches found: 123*123
(123*123 being the math problem).
Any ideas???
I'm still getting
zsh: no matches found: 2*2
when i enterp 2*2
I'm using zsh by the way, but I don't think that should make much of a difference. – AtHeartEngineer – 2014-06-19T23:04:09.050
Is
pycalc 2*2
working? You added the modifications to .zshrc instead of .bashrc, right? – Bob – 2014-06-19T23:14:24.953Did you reinitialize the terminal with the
reset
command so that the new .bashrc can be read? – Bob – 2014-06-19T23:46:30.4932@BobJ
reset
has nothing to do with reloading~/.bashrc
. It is neither a prerequisite for it nor does it actively reload ~/.bashrc. If you want to load new settings from~/.bashrc
just callsource ~/.bashrc
. – Adaephon – 2014-06-20T05:46:17.943Works!!!! yeah I did add it to zshrc instead of bashrc. i ran zsh again and it works!!!
Thanks! – AtHeartEngineer – 2014-06-20T12:32:50.360