periodic(8): Sync with FreeBSD current
[dragonfly.git] / share / zoneinfo / yearistype.sh
blobdfdcdf0e231662ff3aaac8d10509a109f238cc1e
1 #! /bin/sh
3 : 'This file is in the public domain, so clarified as of'
4 : '2006-07-17 by Arthur David Olson.'
6 case $#-$1 in
7 2-|2-0*|2-*[!0-9]*)
8 echo "$0: wild year: $1" >&2
9 exit 1 ;;
10 esac
12 case $#-$2 in
13 2-even)
14 case $1 in
15 *[24680]) exit 0 ;;
16 *) exit 1 ;;
17 esac ;;
18 2-nonpres|2-nonuspres)
19 case $1 in
20 *[02468][048]|*[13579][26]) exit 1 ;;
21 *) exit 0 ;;
22 esac ;;
23 2-odd)
24 case $1 in
25 *[13579]) exit 0 ;;
26 *) exit 1 ;;
27 esac ;;
28 2-uspres)
29 case $1 in
30 *[02468][048]|*[13579][26]) exit 0 ;;
31 *) exit 1 ;;
32 esac ;;
33 2-*)
34 echo "$0: wild type: $2" >&2 ;;
35 esac
37 echo "$0: usage is $0 year even|odd|uspres|nonpres|nonuspres" >&2
38 exit 1