This is a course page of David Casperson |
|
The
enscript
command can be used to produce nicely formatted listings of files. I
prefer enscripting with
enscript -2rG --prettyprint=cpp
--output=output.ps file.cpp
This produces 2
pages of code per page
in landscape (r
otated) mode with G
audy headers. The
--prettyprint=cpp
is only suitable for C++ code and
causes some keywords to be highlighted.
Typing
enscript --help
gives you a complete list of options.
Note that enscript
ed code looks ugly if it contains
line-wraps. For this reason, keep your code lines to about 80
characters in length. If you consistently get line-wraps think about
how to change your coding style and/or use of text editors.
The
script file
command causes all of the commands that you are executing in a shell
to be captured in file
. When you are finished
collecting command and output that you wish to be in your script file,
type ctl-D (the unix end of file
character).
You should script the compilation and running of your
programs. I am not overly concerned about fraudulent programming, and
prefer to see enscript
ed code to using script
-files.
script
program is that it
captures all of the control character information that your shell
produces to create underlining and to make corrections when you
type delete. In order to remove this junk, use
the scriptfix
program as in
scriptfix script-file
> clean-script-file
Click to return to the cpsc 101 main page.
fall-2024