how to add Integer number and a float number in unix shell script -


i have 2 numbers

value1=686

value2=228.35

i not able add integer , float. please me out result.

i running in bash.

echo 1 + 3.5 | bc  awk "begin {print 1+3.5; exit}"  python -c "print 1+3.5"  perl -e "print 1+3.5" 

just replace numbers variables, eg: echo $n1 + $n2 | bc


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -