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

jQuery clickable div with working mailto link inside -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -