home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume8 / roff_bl / roff < prev   
Text File  |  1989-09-23  |  599b  |  35 lines

  1. # roff by Brian E. Litzinger
  2. TROFF=eroff
  3. TMP=/tmp/roff$$
  4. for file in $*
  5. do
  6.     case $file in
  7.     -*)
  8.         args="$args $file"
  9.     ;;
  10.     *)
  11.         command_line="`head -1 $file`"
  12.         b="`echo $command_line | cut -c1-8`"
  13.         if [ "$b" != '\" exec ' ] ; then
  14.         echo "$file not roff format file!"
  15.         exit 2
  16.         fi
  17.         command="`echo $command_line | cut -c9- `"
  18.         d="sed -e '1d' $file |"
  19.         for i in $command ; do
  20.         if [ "$i" = '$F' ] ; then
  21.             true
  22.         else
  23.             if [ "$i" = "$TROFF" ] ; then
  24.             d="$d $i $args"
  25.             else
  26.             d="$d $i"
  27.             fi
  28.         fi
  29.         done
  30.         #echo $d
  31.         eval $d
  32.     ;;
  33.     esac
  34. done
  35.