home *** CD-ROM | disk | FTP | other *** search
/ HTML - Publishing on the Internet / html_cdrom.iso / tools / html / linux / check / dehtml.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1995-01-14  |  1KB  |  35 lines

  1. #!/bin/sh
  2. #
  3. # Shell script to run dehtml.awk under the best available awk interpreter, and
  4. # avoid problems of invoking old awk, if possible.
  5. #
  6. case `type gawk` in *gawk ) awkntrp='gawk';;
  7.                         * ) case `type nawk` in *nawk ) awkntrp='nawk';;
  8.                                                     * ) awkntrp='awk';;
  9.                             esac;;
  10. esac
  11. case ${HTMLCHEK:-"/"}
  12.     in */ ) ;;
  13.        * ) HTMLCHEK="$HTMLCHEK/";;
  14. esac
  15. if test -s ${HTMLCHEK}dehtml.awk
  16. then
  17.     for px
  18.     do
  19.     case $px
  20.     in -?* ) echo "You are passing flags to the $awkntrp interpreter in argument $px" >&2
  21.              echo "(This may not be what you intended)" >&2 ;;
  22.         * ) ;;
  23.     esac
  24.     done
  25.     echo "Stripping mark-up from file(s) now... (using $awkntrp)" >&2
  26.     $awkntrp -f ${HTMLCHEK}dehtml.awk $@
  27. else
  28.     echo "dehtml.awk is not found.  Either copy it to the current directory, or
  29. set the environment variable HTMLCHEK to the pathname where it is located.
  30. Do \`setenv HTMLCHEK /somedir/' in csh and tcsh, \`HTMLCHEK=/somedir/;
  31. export HTMLCHEK' in sh and its offspring." >&2
  32.     exit 1
  33. fi
  34. exit 0
  35.