Error in Bash script arithmetic syntax -


script:

#!/bin/bash vpct=5.3  echo $((vpct*15))     

error:

./abc.sh: line 5: 5.3: syntax error: invalid arithmetic operator (error token ".3") 

i know don't need script multiply 5.3 * 15, small script single out error. please advise.

besides bc, there other tools can tools can try

awk -v vpct="$vpct" 'begin{print vpct * 15}'  echo $vpct | ruby -e 'print gets.to_f * 15 '  echo  "$vpct 15 * p" | dc 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -