Last active
January 12, 2017 13:50
-
-
Save greymd/7ff39c2f84b0a0a02fdec8e12fcff502 to your computer and use it in GitHub Desktop.
mapfile練習のfizzbuzz
This file contains hidden or 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
| $ echo {'yes " " | (',"mapfile -tc "{'3 -C "echo fizz"','5 -C "echo buzz"','1 -C "echo @"'}" -n100 -O 1;",')'} | \ | |
| bash | sort -k2,2n | awk '{a[$NF]=$1""a[$NF]}END{for (k in a){print k,a[k]}}' | tr -d '@' | |
| $ :() { bc <<<"print $1%3;$1%5" | tr -d '[1-9]' | sed 's/0/Fizz/;s/0/Buzz/'; }; mapfile -n 100 -O 1 -c 1 -C ':' < <(yes) | nl -ba |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment