How do I get the value in parentheses?
The problem, as I understand it, is that it is z
not a number, but something like a form = 1.2345
(that is, the line with =
before the number). I think the best way to make this work is to make the number a z
number. Unfortunately, wcalc
it doesn't seem to have the option to do this, so I resort to using awk
:
# here, at the end ------v
z=`echo "$a*(1+($p/(100*$g)))^((($j)+($m/12)+($t/365))*$g)" | wcalc -EE | awk '{ print $2 }'`
y=`echo "read = ($z/$k)^2" | wcalc` # and perhaps apply a similar transformation here.
echo "$y"
Note that it wcalc
does not remember the assignment read
, though, because the process ends immediately. I don't know what you want to achieve.
source to share