4 ms·
I use dc almost every day. I even do my taxes with it. I will forever be in her (and others) debt...
by every 5y ago
I use dc almost every day. I even do my taxes with it. I will forever be in her (and others) debt...
- alisonatwork 5y agoGlad I'm not the only one. I started using dc for shell scripts before I knew that expr existed, and when some UNIX systems I logged on to spat out a bunch of noise on the console whenever bc was invoked. As a result I started thinking in the stack arithmetic way, and just adopted it as my standard way of doing math on UNIX. Eventually I got so used to it that I also preferred using it on Windows (via Cygwin) over calc.exe. It was a sad day when the developer world moved to Git Bash which either never included dc or stopped including it at some point. After a few years of grumbling with calc.exe and ancient versions of GNU dc that didn't work quite right in a Git Bash console, I discovered Gavin Howard's dc, which works well in Git Bash, and now it's once again one of the first things I install on a new computer. Remarkable how this program written ~50 years ago is still useful today, in whatever rebirthed incarnation. I can't think of many others with such staying power.
- gavinhoward 5y agoIt's good to hear of another person using my `dc`! You're actually the second confirmed user; the other is a die-hard original Unix user that now uses NetBSD. That said, I'm glad my `dc` works for you under Git Bash, but it's weird that GNU `dc` wouldn't work.
- alisonatwork 5y agoI can't remember exactly the problem - it was some time ago - but I think it might have been related to console input. Either it was built for Windows console and didn't quite handle mintty LF, EOF and line wrapping, or the other way around. Usually you can wrangle programs into working by using winpty, but it still didn't operate quite as smoothly as dc did under UNIX (or Cygwin). In the end I mostly ended up invoking it in a pipeline instead of interactively. Fortunately your dc worked out of the box with winpty a couple years back, and - to my delight - I just discovered the latest version works both in a modern Windows console and Git Bash mintty as well, without any winpty wrapping. Great work, thank you!
- gavinhoward 5y agoYou're very welcome.
- tannhaeuser 5y agovi, in its various incarnations, comes to mind.
- every 5y agoGiven the antiquity of dc, ed would probably be a better match. And nobody willingly uses ed anymore...
- thanatos519 5y agoI <3 RPN and depend on dc every day and use it for calculations in shell pipelines! RIP.