home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


vgrind [options ] files

Solaris only (from the BSD command). Produce nicely formatted source code listings for use with troff . vgrind formats program source code so that it looks good when typeset with troff . Comments are in italic, keywords in bold, and each function's name is printed in the margin of the page where it is defined. Definitions for each language are kept in /usr/lib/vgrindefs . vgrind can format a number of languages; see -l below.

vgrind has two modes of operation:

Filter mode

Similar to eqn , pic , and tbl . Lines are passed through unchanged, except for those bracketed by .vS and .vE . In this mode, vgrind can be used in a pipeline with other preprocessors.

Regular mode

vgrind processes all files named on the command line and then invokes troff to print them. Use - as a filename to mean the standard input. Otherwise, vgrind will not read standard input.


Spacing between option characters and option arguments is specific. Use the options exactly as shown here:


Produce two-column output. Implies -s8 and the -L (landscape) option for $TROFF . (This option was specific to troff at UCB.)

-d definitions

Use definitions as the file with language definitions, instead of the default file.


Run in filter mode.

-h header

Place header in the top center of every output page.

-l lang

Supported languages are:

Bourne shell -lsh
C -lc
C++ -lc++
C shell -lcsh
emacs MLisp -lml
Icon -lI
ISP -li
Model -lm
Modula-2 -lm2
Pascal -lp
Russel -lrussell
YACC -lyacc

The default is -lc (for C).


Do not use bold for keywords.

-s size

Use point size size (same as troff 's .ps request).


Use a tab stop of four columns, instead of the default eight.


Print the index. If a file named index exists in the current directory, vgrind writes the index into it. This file can then be formatted and printed separately using vgrind -x index .

Typesetter Options

The following options are passed to the program named by $TROFF , or to troff if that environment variable is not set:

-o list

Output only the pages in list ; same as -o in troff .

-P printer

Send the output to printer .


Same as -t for troff ; send formatted text to standard output.

-T device

Format output for device .


Use the wide Versatec printer instead of the narrow Varian. (These refer to printers that existed at one time at the University of California at Berkeley. This option likely has no real effect under Solaris.)

Previous: Reference: vedit UNIX in a Nutshell: System V Edition Next: Reference: vi
Reference: vedit Book Index Reference: vi

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System