#! /bin/sh : 'This file is in the public domain, so clarified as of' : '2006-07-17 by Arthur David Olson.' match $Argc-$1 { with 2-|2-0*|2-*[!0-9]* echo "$0: wild year: $1" > !2 exit 1 } match $Argc-$2 { with 2-even match $1 { with *[24680] exit 0 with * exit 1 } with 2-nonpres|2-nonuspres match $1 { with *[02468][048]|*[13579][26] exit 1 with * exit 0 } with 2-odd match $1 { with *[13579] exit 0 with * exit 1 } with 2-uspres match $1 { with *[02468][048]|*[13579][26] exit 0 with * exit 1 } with 2-* echo "$0: wild type: $2" > !2 } echo "$0: usage is $0 year even|odd|uspres|nonpres|nonuspres" > !2 exit 1