On Tuesday 19 December 2006 12:22, Craig FALCONER wrote: > How about an insanely silly solution... > > ThisMACUsage = `echo $ThisMACUsage + $IPMax - $IPMin | /usr/bin/bc -` > > ? Um. Perhaps that should be:- ThisMACUsage=`echo $ThisMACUsage + $IPMax - $IPMin | /usr/bin/bc`
OTOH, seeing as he is doing arithmetic on integers how about using the much simpler RPN calculator 'dc'. ThisMACUsage = \ `echo "$ThisMACUsage $IPMax $IPMin" - + p | /usr/bin/dc` Sane suggestions include reading Chapter 7 of the Advanced Bash Scripting Guide, the appropriate man pages, and help for the built-in commands. http://tldp.org/LDP/abs/html/ man dc man bc help [ help [[ -- CS
