I am trying outputing result in floating point using bc in bash.But I am getting the following output for the following code.How can i get the multiplication result from here and also why i am getting command not found.
#!/bin/bash
v1=3.41
v2=45
v3= $(bc <<< "scale=4;$v1 + $v2")
echo $v3
v3= $(bc <<< "scale=4;$v1 - $v2")
echo $v3
v3= $(bc <<< "scale=4;$v1 / $v2")
echo $v3
v3= $(bc <<< "scale=4;$v1 % $v2")
echo $v3
v3 = $(bc <<< "scale=4;$v1 * $v2")
echo $v3
the output i am getting is below :
mint@mint ~ $ bash bc.sh
bc.sh: line 4: 48.41: command not found
bc.sh: line 6: -41.59: command not found
bc.sh: line 8: .0757: command not found
bc.sh: line 10: .0035: command not found
bc.sh: line 12: v3: command not found