getting 'more' to not count termcap formatting strings

John Peace peace at geiger.rtp.dg.com
Tue Feb 19 18:14:59 AEST 1991


In article <1991Feb7.151700.11770 at unhd.unh.edu> rg at msel.unh.edu (Roger Gonzalez) writes:
>I wrote a termcap based hex file dump program that works really well, and
>has lots of features, but it would be nice to be able to pipe the output
>through 'more'.   'more' screws up because its count of characters coming
>into it isn't the same as what actually gets shown on the screen.  Is there
>a standard way to do this?
>
Try 'more -f'.  This essentially turns off the pager's splitting of
long lines into multiple lines.  The non-printing escape sequences
won't confuse 'more' this way, but then each line of text is expected
to fit on one line of the screen.  Here's what more(1) says in TFM:

   -f   This causes 'more' to count logical lines, rather than
	screen lines.  That is, long lines are not folded.
	This option is recommended for viewing ul(1) output,
	since it may contain escape sequences.  These escape
	sequences contain characters which would ordinarily
	occupy screen positions, but which do not print when
	they are sent to the terminal as part of an escape
	sequence.  Thus 'more' may think that lines are longer
	than they actually are, and fold lines erroneously.

(I use 'more -f' all the time for viewing formatted man page output.)
----
John R. Peace			CSnet:       peace at dg-rtp.dg.com
Data General Corporation	UUCP:        ...!mcnc!rti!xyzzy!peace
Research Triangle Park, NC	Disclaimer:  Speaking for me, not DG.



More information about the Comp.unix.questions mailing list