We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Linux Shell
- Bash
- Arithmetic Operations
- Discussions
Arithmetic Operations
Arithmetic Operations
Sort by
recency
|
239 Discussions
|
Please Login in order to post a comment
Just another way using here strings "<<<"
read expression result=expression") printf "%.3f\n" "$result"
SOLVED
start of script
!/bin/bash
read expression result=expression" | bc -l) rounded_res=result") echo $rounded_res
read expr
result=expr" | bc -l)
printf "%.3f\n" "$result"