When pointless error messages attack
Something that always annoyed me in bc, the ever-handy calculator language present on all unix systems.. all I can ask is why? Why? WHY?
[lyra:~] kasia% bc bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 2+2 4(interrupt) use quit to exit.
quit
[lyra:~] kasia%
In case it's not self-evident, bc traps ^c and spouts out that stupid message..
(Yes, I know it has nothing to do with Java, but I use my Java category for all programming-related crap)
Comments
Ctrl-D (end of input) will work. I've never understood that UNIX mindset that wants to trap Ctrl-C.
Here's some complementary stupidness: If you enter "quit" or "exit" in the Python interpreter, it will respond with "Use Ctrl-D (i.e. EOF) to exit."
Posted by: Kris Johnson | November 16, 2005 07:08 PM
Perhaps bc is using ^C as a way to cancel a long calculation, hence the trap?
Posted by: Bryan | November 16, 2005 11:21 PM
Why don't do a bugtraq ?
Posted by: jop | November 17, 2005 07:48 AM
Just for the record, I do CTRL-C every single time I use bc interactively.
In any case I have switched to Google.
A Firefox keyword shortcut of "g" pointing to "http://www.google.com/search?hl=en&q=%s&btnG=Google+Search" will let you do something like:
"g 2+2" in the address bar
Posted by: Joe Grossberg | November 17, 2005 11:04 AM
Kris said:
> Here's some complementary stupidness: If you enter "quit" or "exit" in the Python interpreter, it will respond with "Use Ctrl-D (i.e. EOF) to exit."
I agree that trapping CTRL+C in bc seems pointless (lazy maybe?), but try this at the python prompt:
>>> type(exit)
You'll see that it's just an ordinary string. The developers didn't want to muck up the default namespace with extra keywords, so they just gave a nice informative message for people trying to get out.
Posted by: Daniel | November 17, 2005 10:02 PM
Real geeks use dc, not bc (and no trapping of ^C either)
:-)
Posted by: Steve Friedl | November 20, 2005 12:38 PM
^C^C^C^C^C^C^C^C^C^C
Posted by: Jeremy | November 21, 2005 09:03 PM
I thought you were a unix girl! Control-D
(it works in bc too)
Brian
Posted by: Brian | November 22, 2005 09:10 PM
I allways thought that was stupid of bc too.
Posted by: bram | November 29, 2005 09:35 PM