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

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -