~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/timezone/data/yearistype.sh

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
: '@(#)yearistype.sh    7.7'
 
4
 
 
5
case $#-$1 in
 
6
        2-|2-0*|2-*[!0-9]*)
 
7
                echo "$0: wild year - $1" >&2
 
8
                exit 1 ;;
 
9
esac
 
10
 
 
11
case $#-$2 in
 
12
        2-even) 
 
13
                case $1 in
 
14
                        *[24680])                       exit 0 ;;
 
15
                        *)                              exit 1 ;;
 
16
                esac ;;
 
17
        2-nonpres|2-nonuspres)
 
18
                case $1 in
 
19
                        *[02468][048]|*[13579][26])     exit 1 ;;
 
20
                        *)                              exit 0 ;;
 
21
                esac ;;
 
22
        2-odd)  
 
23
                case $1 in
 
24
                        *[13579])                       exit 0 ;;
 
25
                        *)                              exit 1 ;;
 
26
                esac ;;
 
27
        2-uspres)
 
28
                case $1 in
 
29
                        *[02468][048]|*[13579][26])     exit 0 ;;
 
30
                        *)                              exit 1 ;;
 
31
                esac ;;
 
32
        2-*)    
 
33
                echo "$0: wild type - $2" >&2 ;;
 
34
esac
 
35
 
 
36
echo "$0: usage is $0 year even|odd|uspres|nonpres|nonuspres" >&2
 
37
exit 1