Вот полезный кусок из моего ~/.bashrc:
function round(){ [ "$2" = "" ] && NUM=3 || NUM=$2; echo $1 | sed "s/\([[:digit:]]*\.[[:digit:]]\{,$NUM\}\).*/\1/"; }
function sin(){ echo "scale=10; s($1*a(1)/45);" | bc -l; }
function cos(){ echo "scale=10; c($1*a(1)/45);" | bc -l; }
function tan(){ echo "scale=10; arg=$1*a(1)/45; s(arg)/c(arg);" | bc -l; }
function logn(){ echo "scale=10; l($1);" | bc -l; }
function log(){ echo "scale=10; l($1)/l(10);" | bc -l; }
function pow(){ echo "scale=10; ($1)^($2);" | bc -l; }
function sqrt(){ echo "scale=10; sqrt($1);" | bc -l; }
function exp(){ echo "scale=10; e($1);" | bc -l; }
function bin2hex(){ echo "obase=16;ibase=2;$1" | bc; }
function bin2dec(){ echo "obase=10;ibase=2;$1" | bc; }
function dec2hex(){ echo "obase=16;ibase=10;$1" | bc; }
function lower(){ echo $1 | tr [:upper:] [:lower:]; }
function upper(){ echo $1 | tr [:lower:] [:upper:]; }
function hex2binary(){ echo "obase=2;ibase=16; $(upper $1)" | bc; }
function hex2dec(){ echo "obase=10;ibase=16; $(upper $1)" | bc; }
alias pi="echo 'scale=10; a(1)*4;' | bc -l"
export PI=$(pi)