tzdata: update to 2018g
[unleashed.git] / contrib / tzdata / yearistype.sh
blobd6741759e88bc4cb1be97c9a254573021fa5b5e2
1 #! /bin/sh
2 : 'Determine whether year is of appropriate type (this file is obsolete).'
4 : 'This file is in the public domain, so clarified as of'
5 : '2006-07-17 by Arthur David Olson.'
7 case $#-$1 in
8 2-|2-0*|2-*[!0-9]*)
9 echo "$0: wild year: $1" >&2
10 exit 1 ;;
11 esac
13 case $#-$2 in
14 2-even)
15 case $1 in
16 *[24680]) exit 0 ;;
17 *) exit 1 ;;
18 esac ;;
19 2-nonpres|2-nonuspres)
20 case $1 in
21 *[02468][048]|*[13579][26]) exit 1 ;;
22 *) exit 0 ;;
23 esac ;;
24 2-odd)
25 case $1 in
26 *[13579]) exit 0 ;;
27 *) exit 1 ;;
28 esac ;;
29 2-uspres)
30 case $1 in
31 *[02468][048]|*[13579][26]) exit 0 ;;
32 *) exit 1 ;;
33 esac ;;
34 2-*)
35 echo "$0: wild type: $2" >&2 ;;
36 esac
38 echo "$0: usage is $0 year even|odd|uspres|nonpres|nonuspres" >&2
39 exit 1