From: utzoo!decvax!duke!mcnc!ncsu!msdc!dan Newsgroups: net.unix-wizards,net.sources Title: Re: Idea for useful utility Article-I.D.: msdc.1018 Posted: Wed Apr 20 13:18:55 1983 Received: Fri Apr 22 05:37:29 1983 We too had countless problems trying to remember how to run an 'nroff' document. We (and our secretaries) have been using a little shell program called 'runoff' for some time now. By putting a special comment line at the beginning of an 'nroff' file, you can get it formatted by entering runoff 'Runoff' expects the first line of the first file named on the command line to contain an nroff-style comment as follows: .\" The command can contain 'sh' variable substitutions, since it is executed by the shell that executes 'runoff'. Most importantly, "$1" is replaced by the first argument to 'runoff'. Most of our things document files begin something like this: .\" tbl $1 | nroff -mm | col Dan Forsyth (decvax!duke!mcnc!msdc!dan) Medical Systems Development Corp. ====================================== : # runoff --- format and print a document using its first # line as the command if CMD=`head -1 $1`; then : else exit fi if expr 0 = X"$CMD" : '^X\. *\\"' >/dev/null; then echo 'First line of document must be .\\" ' 1>&2 exit 1 fi NCMD=`echo "$CMD" | sed 's/^\. *\\\" *//'` eval "$NCMD" ======================================