Fix typo: firmare -> firmware
[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.4 2006/10/08 08:56:37 swildner Exp $
5 : 'This file is in the public domain, so clarified as of'
6 : '2006-07-17 by Arthur David Olson.'
7
8 : '@(#)yearistype.sh    8.2'
9
10 case $#-$1 in
11         2-|2-0*|2-*[!0-9]*)
12                 echo "$0: wild year - $1" >&2
13                 exit 1 ;;
14 esac
15
16 case $#-$2 in
17         2-even)
18                 case $1 in
19                         *[24680])                       exit 0 ;;
20                         *)                              exit 1 ;;
21                 esac ;;
22         2-nonpres|2-nonuspres)
23                 case $1 in
24                         *[02468][048]|*[13579][26])     exit 1 ;;
25                         *)                              exit 0 ;;
26                 esac ;;
27         2-odd)
28                 case $1 in
29                         *[13579])                       exit 0 ;;
30                         *)                              exit 1 ;;
31                 esac ;;
32         2-uspres)
33                 case $1 in
34                         *[02468][048]|*[13579][26])     exit 0 ;;
35                         *)                              exit 1 ;;
36                 esac ;;
37         2-*)
38                 echo "$0: wild type - $2" >&2 ;;
39 esac
40
41 echo "$0: usage is $0 year even|odd|uspres|nonpres|nonuspres" >&2
42 exit 1