tools/keyboardio-builder: Use awk instead of bc

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/84/head
Gergely Nagy 8 years ago
parent 7bca9e9497
commit fa51f17ac4

@ -11,13 +11,7 @@ firmware_size () {
PROGSIZE="$(echo "${output}" | grep Program: | cut -d: -f2 | awk '{print $1}')" PROGSIZE="$(echo "${output}" | grep Program: | cut -d: -f2 | awk '{print $1}')"
PERCENT=$(cat <<EOF PERCENT="$(echo ${PROGSIZE} ${MAX_PROG_SIZE} | awk "{ printf \"%02.01f\", \$1 / \$2 * 100 }")"
scale=2
${PROGSIZE} / ${MAX_PROG_SIZE} * 100
EOF
)
PERCENT=$(printf %02.01f $(echo "${PERCENT}" | bc -q))
echo "${output}" | sed -e "s,\(Program:.*\)(\([0-9\.]*%\) Full),\1(${PERCENT}% Full)," echo "${output}" | sed -e "s,\(Program:.*\)(\([0-9\.]*%\) Full),\1(${PERCENT}% Full),"
} }

Loading…
Cancel
Save