I use bash calculator for floating point calculations and I have to use input redirection and backtick (`) symbol in scripts.
As normal bracket
$[math operation] and expr doesn't support float calculation.
Is there any other way to do float calculation directly instead of using bc in script.
I don't like unnecessary input redirection and backtick (`) symbol for scripts.
#!/bin/bash x=5 y=6 z=3.3 result=`bc <<end scale=3 temp_divide=($x / $y) temp_divide * $z end` echo "final result is $result"