43.8 Fixing Margins with pr and foldThe System V version of pr (43.7 ) has a -F option for folding lines that are too wide for the output page: the printer won't truncate them. If you print lots of random data and stuff that may have long lines and your pr doesn't have -F , try the fold command instead. fold arbitrarily breaks lines that are too long, by default at 80 columns. Use -width where width is the desired column to fold at for some other breaking point. I made an
alias (10.2
)
and
shell function (10.9
)
called prF
to do that.
It prints a single file and puts the filename in the pr
heading
(usually, if you pipe to pr
, it won't know the filename).
You might want to add alias prF 'fold \!^ | pr -h "\!^"'
alias prnF 'cat -n \!^ | fold | pr -h "\!^"' To shorten lines by folding them after a word near the right-hand end (instead of at some particluar column), try fmt (35.2 ) . - |
|