Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for year in {2000..2050}
- do
- num=$(cal $year|awk '{print $6 " " $13 " " $20}'|tr ' ' '\n'|grep -c 13)
- echo "$year has $num Friday the 13th's"
- done
- #oneliner
- #for year in `seq 2000 2050`;do echo "$year has $(cal $year|awk '{print $6 " " $13 " " $20}'|tr ' ' '\n'|grep -c 13) Friday the 13th's";done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement