Oct 30, 2013

[memo] shell script percentage calculate

Just for me.

#!/bin/sh
a=2
b=3
echo "scale=1; (100 * $a / $b)" | bc
#Result is 66.6
view raw percent.sh hosted with ❤ by GitHub

No comments: