Thursday, October 20, 2011

How to use Binary Calculator (bc) in scripts

The script below, performs 22 / 7, using bc with scale = 5




bc can also be used in the scripts, to convert a number from decimal to binary (obase=2)

Unix and Shell Programming - Notes