« Flowery Beetles? | Main | 5 seconds of fame »

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."

Perhaps bc is using ^C as a way to cancel a long calculation, hence the trap?

Why don't do a bugtraq ?

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

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.

Real geeks use dc, not bc (and no trapping of ^C either)

:-)

^C^C^C^C^C^C^C^C^C^C

I thought you were a unix girl! Control-D

(it works in bc too)

Brian

I allways thought that was stupid of bc too.