8ba42fabaa31424a9b03c265f8a3b9ace1a3c8c6
[dragonfly.git] / share / zoneinfo / yearistype.sh
1 #! /bin/sh
2
3 # $FreeBSD: src/share/zoneinfo/yearistype.sh,v 1.1.2.3.8.1 2000/10/25 19:44:09 wollman Exp $
4 # $DragonFly: src/share/zoneinfo/yearistype.sh,v 1.2 2003/06/17 04:37:04 dillon Exp $
5
6 : '@(#)yearistype.sh    7.7'
7
8 case $#-$1 in
9         2-|2-0*|2-*[!0-9]*)
10                 echo "$0: wild year - $1" >&2
11                 exit 1 ;;
12 esac
13
14 case $#-$2 in
15         2-even) 
16                 case $1 in
17                         *[24680])                       exit 0 ;;
18                         *)                              exit 1 ;;
19                 esac ;;
20         2-nonpres|2-nonuspres)
21                 case $1 in
22                         *[02468][048]|*[13579][26])     exit 1 ;;
23                         *)                              exit 0 ;;
24                 esac ;;
25         2-odd)  
26                 case $1 in
27                         *[13579])                       exit 0 ;;
28                         *)                              exit 1 ;;
29                 esac ;;
30         2-uspres)
31                 case $1 in
32                         *[02468][048]|*[13579][26])     exit 0 ;;
33                         *)                              exit 1 ;;
34                 esac ;;
35         2-*)    
36                 echo "$0: wild type - $2" >&2 ;;
37 esac
38
39 echo "$0: usage is $0 year even|odd|uspres|nonpres|nonuspres" >&2
40 exit 1