Ok, so I'm trying to round up an input of
echo "scale = 3; $input" | bc -l
input contains a number, there is no need for an external command like
bc. You can just use
printf "%.3f\n" "$input"
Edit: In case the input is a formula, you should however use
bc as in one of the following commands:
printf "%.3f\n" $(bc -l <<< "$input") printf "%.3f\n" $(echo "$input" | bc -l)