home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / ixemul-45.0-src.tgz / tar.out / contrib / ixemul / utils / yearistype.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1996-09-28  |  509b  |  27 lines

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