home *** CD-ROM | disk | FTP | other *** search
/ HTML - Publishing on the Internet / html_cdrom.iso / tools / html / linux / check / htmlchkp.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1995-02-19  |  2KB  |  52 lines

  1. #!/bin/sh
  2. #
  3. # Shell script to run htmlchek.pl with options checking.  (In this release of
  4. # the htmlchek package, htmlchek.pl actually does internal options checking.)
  5. #
  6. nonvar='NO'
  7. for px
  8. do
  9.  case $px
  10.  in *=* ) if   test $nonvar = 'YES'
  11.           then echo "Error: An option=value argument $px followed" >&2
  12.                echo "a filename argument on the command line." >&2
  13.                exit 1
  14.           else
  15.             case $px
  16.             in append=* | arena=* | configfile=* | deprecated=* |\
  17.                dirprefix=* | dlstrict=* | html3=* | htmlplus=* | loosepair=* |\
  18.                lowlevelnonpair=* | lowlevelpair=* | map=* | metachar=* |\
  19.                netscape=* | nogtwarn=* | nonblock=* | nonpair=* |\
  20.                nonrecurpair=* | novalopts=* | nowswarn=* | refsfile=* |\
  21.                reqopts=* | strictpair=* | subtract=* | sugar=* | tagopts=* |\
  22.                usebase=* | xref=* | cf=* | inline=* | lf=* | listfile=* ) ;;
  23.              * ) echo "Error: In the option=value argument $px, the part" >&2
  24.                  echo "before the equals sign \`=' is not a recognized option." >&2
  25.                  exit 1;;
  26.             esac
  27.           fi;;
  28.       * ) nonvar='YES';;
  29.  esac
  30. done
  31. #
  32. case ${HTMLCHEK:-"/"}
  33.     in */ ) ;;
  34.        * ) HTMLCHEK="$HTMLCHEK/";;
  35. esac
  36. if test -s ${HTMLCHEK}htmlchek.pl
  37. then
  38.     echo "Checking file(s) now... (using perl)" >&2
  39.     perl ${HTMLCHEK}htmlchek.pl $@
  40.     if test $? -ne 0
  41.     then echo "Note: there was apparently an error in running perl" >&2
  42.          exit 1
  43.     fi
  44. else
  45.     echo "htmlchek.pl is not found.  Either copy it to the current directory, or
  46. set the environment variable HTMLCHEK to the pathname where it is located.
  47. Do \`setenv HTMLCHEK /somedir/' in csh and tcsh, \`HTMLCHEK=/somedir/;
  48. export HTMLCHEK' in sh and its offspring." >&2
  49.     exit 1
  50. fi
  51. exit 0
  52.