Can anyone please tell me how I should go about assigning the value of the square root of a number to a variable in Bash?
This is my code.
#!/bin/bash
a=5
c=sqrt"($a)"|bc -l
echo "$c"
When executed, it displays nothing
However, I observe that when the following is executed,
#!/bin/bash
a=5
echo sqrt"($a)"|bc -l
I get an answer
2.23606797749978969640
Can someone tell me as to how I could bind the value of the square root of a to c?
Thanks.