1
For some reason calc always becomes interactive (as if I had specified -i, or not specified an expression at all). I have to press CTRL-C multiple times to exit.
~ calc 5+4
9
^C
[Abort level 1]
^C
[Abort level 2]
^C
[Abort level 3]
^C
ABORT
~
It worked fine on my old mac. I installed it using brew (on both machines), and reinstalling calc doesnt help. What could be the reason?
Edit: I've tried starting a clean bash shell, I've checked aliases, and I've tried to use -q -e
to ignore environment and configuration files. None of these things have helped.
~ type -a calc
calc is /usr/local/bin/calc
~ calc -q -e 5+4
does not change the behaviour.
~ env -i bash --noprofile --norc
bash-3.2$ calc 5+4
doesnt help either.
~ ls -l /usr/local/bin/calc
lrwxr-xr-x 1 lafp admin 34 Feb 28 14:43 /usr/local/bin/calc -> ../Cellar/calc/2.12.7.1_1/bin/calc`
I did find something that does help. Switching to a different user! (in this case root).
~ sudo su
root@... calc 5+4
9
root@...
I have checked for aliases:
calc is /usr/local/bin/calc
. Did you see anything in the documentation that mentions startup files? I didnt... – Cyberwiz – 2019-02-28T10:07:34.057I also tried running with a clean environment (
env -i /usr/local/bin/calc 5+5
), and it gave the same result. – Cyberwiz – 2019-02-28T10:10:28.773Even starting a clean bash session (
env -i bash --noprofile --norc
) doesnt help. – Cyberwiz – 2019-02-28T10:12:23.570I had no idea calc had startup files, sorry for not checking myself. Unfortunately -q -e didnt help (I dont have any custom startup files).
No, I meant that I got stuck in interactive mode, just as before. I have updated the question. – Cyberwiz – 2019-02-28T13:52:07.277
Switching to a different user (root) seems to help... Updated the question. – Cyberwiz – 2019-02-28T13:56:07.273
root may use different
$PATH
and therefore different version ofcalc
. Investigate this. – Kamil Maciorowski – 2019-02-28T13:58:53.113I checked, they both use /usr/local/bin/calc. – Cyberwiz – 2019-03-01T13:19:53.990