BC Extensions

Here are some very useful extensions for bc – the unix command line calculator program. These files were created by Steffen Brinkmann for the Xbc Project and are distributed under GPL license.

  1. extensions.bc – defines useful functions such as sin, ln, log, etc
  2. scientific_constants.bc – defines many useful scientific constants

To use them simply specify them on the command line when you run bc:

bc extensions.bc scientific_constants.bc

If you want to use them all the time, it is probably a good idea to create an alias in your .bashrc:

alias bc='bc -l extensions.bc scientific_constants.bc'

Installation script – run this to install these extensions on your system and create an alias in your bashrc:

#!/usr/bin/bash
mkdri ~/.bc
cd ~/.bc
wget http://terminally-incoherent.com/stuff/bc/*bc
cd
echo alias bc='bc -l .bc/extensions.bc .bc/scientific_constants.bc'

One Response to BC Extensions

  1. JuEeHa FINLAND Mozilla Firefox Mac OS says:

    Did you mean mkdir instead of mkdri?

    Reply  |  Quote

Leave a Reply

Your email address will not be published. Required fields are marked *