Really sorry to bother but if anyone can help that would be amazing. I am trying to learn bash programming and functions, and so I have written a simple celcius/farenheit converter. But it doesn't work for some reason - even though all the echo to bc commmands work just fine in the terminal with the same syntax.
read -p "enter number in C followed by <ENTER> ==> " resp
part1=echo "scale=2;$VAR1 / $VAR2" | bc
part2=echo "scale=2;$part1 * $resp" | bc
answer_c2f=echo "scale2;$part2 + $VAR3" | bc
read -p "enter number in F followed by <ENTER> ==> " resp
part1=echo "scale=5;$resp - $VAR3" | bc
part2=echo "scale=5;$VAR2 * $VAR1" | bc
answer_f2c=echo "scale=2;$part2 * $part1" | bc
echo "Is your temperature in celsius or farenheit [C/F]?"
if [ $temp_type == C ]; then
elif [ $temp_type == F ]; then
else echo "unrecognized temp format; please type either C or F [caps]"