bash 的浮点除法 #! /bin/bash LX=100 for i in 1 2 3 do c=$(echo "scale=2;$i/$LX"|bc) echo -n "0$c "; done echo;