#!/bin/ksh -p math=$(print "$*" "+0" | bc -l 2> /dev/null) if [[ "$math" == '0' ]] ; then print 0 elif [[ "$math" == '' ]] ; then print "$*" else print "$math" fi