bc is cool, but it can not access shell variables directly, but you can pass them with <<<
also there is no “pi” constant in bc that you could use in interactive mode.
let one assume you would like to calculate extend “umfang” of a circle with radius 5
Extend/Umfang U = 2 · π · r
pi=$(echo "scale=10; 4*a(1)" | bc -l); # calc value of pi 10 digits and store it in variable $pi echo $pi; # test output 3.1415926532 bc <<< "scale=10 ; 2*$pi*5"; # do the calculation 31.4159265320