This is related to my previous question: Making shapes with linux shell script
I'm trying to write a shell script program with VIM that given sides A and B of the Pythagorean Theorem, it will provide C. Here is my code:
echo -n "Enter A: "
read A
echo -n "Enter B: "
read B
BSquared=$(($B**2))
ASquared=$((A**2))
CSquared=$(($B+$A))
Hypot='echo"scale=2;sqrt($CSquared)"|bc'
echo '
+
|\
| \ C
A | \
| \
+----
B '
echo "A = $A"
echo "B = $B"
echo "C = $Hypot"
The triangle part is just for fun. The only thing wrong with my script is that on the line:
echo "C = $Hypot"
The output is as follows:
C = "scale=2;sqrt($CSquared)"|bc
In other words, the code from the script. Can anyone tell me what I'm doing wrong?