home *** CD-ROM | disk | FTP | other *** search
/ Aminet 10 / aminetcdnumber101996.iso / Aminet / util / gnu / groff_src.lha / groff-1.10src / nroff / nroff.sh < prev   
Linux/UNIX/POSIX Shell Script  |  1994-11-30  |  888b  |  62 lines

  1. #!/bin/sh
  2. # Emulate nroff with groff.
  3.  
  4. prog="$0"
  5. # Default device.
  6. if test "X$LC_CTYPE" = "Xiso_8859_1" || test "X$LESSCHARSET" = "Xlatin1"
  7. then
  8.     T=-Tlatin1
  9. else
  10.     T=-Tascii
  11. fi
  12. opts=
  13.  
  14. for i
  15. do
  16.     case $1 in
  17.     -h)
  18.         opts="$opts -P-h"
  19.         ;;
  20.     -[eq]|-s*)
  21.         # ignore these options
  22.         ;;
  23.     -[mrnoT])
  24.         echo "$prog: option $1 requires an argument" >&2
  25.         exit 1
  26.         ;;
  27.     -i|-[mrno]*)
  28.         opts="$opts $1";
  29.         ;;
  30.  
  31.     -Tascii|-Tlatin1)
  32.         T=$1
  33.         ;;
  34.     -T*)
  35.         # ignore other devices
  36.         ;;
  37.     -u*)
  38.         # Solaris 2.2 `man' uses -u0; ignore it,
  39.         # since `less' and `more' can use the emboldening info.
  40.         ;;
  41.     --)
  42.         shift
  43.         break
  44.         ;;
  45.     -)
  46.         break
  47.         ;;
  48.     -*)
  49.         echo "$prog: invalid option $1" >&2
  50.         exit 1
  51.         ;;
  52.     *)
  53.         break
  54.         ;;
  55.     esac
  56.     shift
  57. done
  58.  
  59. # This shell script is intended for use with man, so warnings are
  60. # probably not wanted.  Also load nroff-style character definitions.
  61. exec groff -Wall -mtty-char $T $opts ${1+"$@"}
  62.