Created
August 2, 2014 07:09
-
-
Save ryo1kato/0af89dcd75b643c27ead to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
n=$(<"$1") | |
nums=($n) | |
i=$(sort -nr $1|head -1) | |
while ((i--)) | |
do | |
for num in "${nums[@]}" | |
do | |
if [ $i -gt $num ]; then | |
echo -n " " | |
else | |
echo -n " * " | |
fi | |
done | |
echo | |
done | |
for num in "${nums[@]}" | |
do | |
printf ' %-2d' $num | |
done | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment