Deleted Added
full compact
yearistype.sh (240457) yearistype.sh (270728)
1#! /bin/sh
2
3: 'This file is in the public domain, so clarified as of'
4: '2006-07-17 by Arthur David Olson.'
5
6case $#-$1 in
7 2-|2-0*|2-*[!0-9]*)
1#! /bin/sh
2
3: 'This file is in the public domain, so clarified as of'
4: '2006-07-17 by Arthur David Olson.'
5
6case $#-$1 in
7 2-|2-0*|2-*[!0-9]*)
8 echo "$0: wild year - $1" >&2
8 echo "$0: wild year: $1" >&2
9 exit 1 ;;
10esac
11
12case $#-$2 in
13 2-even)
14 case $1 in
15 *[24680]) exit 0 ;;
16 *) exit 1 ;;

--- 9 unchanged lines hidden (view full) ---

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-*)
9 exit 1 ;;
10esac
11
12case $#-$2 in
13 2-even)
14 case $1 in
15 *[24680]) exit 0 ;;
16 *) exit 1 ;;

--- 9 unchanged lines hidden (view full) ---

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 ;;
34 echo "$0: wild type: $2" >&2 ;;
35esac
36
37echo "$0: usage is $0 year even|odd|uspres|nonpres|nonuspres" >&2
38exit 1
35esac
36
37echo "$0: usage is $0 year even|odd|uspres|nonpres|nonuspres" >&2
38exit 1