• API
• FAQ
• Tools
• Archive
SHARE
TWEET # Untitled a guest Dec 10th, 2018 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. if test \$# -lt 3
2. then
3.     day=\$1
4.     year=\$2
5. fi
6. if test \$# -lt 2
7. then
8.     day=\$1
9.     year=\$(date +%Y)
10. fi
11. cm=1
12. cdn=\$(date -d "\$year-\$cm-\$day" +%A)
13. mas=(0 0 0 0 0 0 0 0 0 0 0 0)
14. dn=\$cdn
15. counter=1
16. m=1
17. j=1
18. while (("\$j" <= 11)); do
19. i=\$((\$j+1))
20. while (("\$i" <= 12));  do
21.     cm=\$i
22.     cdn=\$(date -d "\$year-\$cm-\$day" +%A)
23.     if [ "\$cdn" = "\$dn" ]; then
24.         counter=\$((\$counter+1))
25.     fi
26.     cmn=\$(date -d "\$year-\$cm-\$day" +%B)
27.     if [ "\$counter" = "2" ]; then
28.     if [ "\$cdn" = "\$dn" ]; then
29.     if [ "\${mas[\$i]}" = "0" ]; then
30.         printf "\$day is \$cdn in:\n"
31.         printf  "\$(date -d "\$year-\$m-\$day" +%B)\n"
32.         printf "\$cmn\n"
33.         mas[\$i]=1
34.     fi
35.     fi
36.     fi
37.     if (("\$counter" > "2")); then
38.     if [ "\$cdn" = "\$dn" ]; then
39.     if [ "\${mas[\$i]}" = "0" ]; then
40.         printf "\$cmn\n"
41.         mas[\$i]=1
42.     fi
43.     fi
44.     fi
45.     i=\$((\$i+1))
46. done
47. j=\$((\$j+1))
48. m=\$j
49. counter=1
50. dn=\$(date -d "\$year-\$m-\$day" +%A)
51. done
52. exit \$?
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top