Skip to content

Instantly share code, notes, and snippets.

@ryo1kato
Created August 2, 2014 07:09
Show Gist options
  • Save ryo1kato/0af89dcd75b643c27ead to your computer and use it in GitHub Desktop.
Save ryo1kato/0af89dcd75b643c27ead to your computer and use it in GitHub Desktop.
#!/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