#!/bin/bash # scriptbc--Wrapper for 'bc' that returns the result of a calculation if test $1 = "-p" { setglobal precision = $2 shift 2 } else { setglobal precision = '2' # default } bc -q << """ scale=$precision $ifsjoin(Argv) quit """ exit 0