When I went to answer this question, I was going to use the ${}
notation, as I've seen so many times on here that it's preferable to backticks.
However, when I tried
joulesFinal=${echo $joules2 * $cpu | bc}
I got the message
-bash: ${echo $joules * $cpu | bc}: bad substitution
but
joulesFinal=`echo $joules2 * $cpu | bc`
works fine. So what other changes do I need to make?
Question&Answers:os