xref: /freebsd/usr.bin/col/README (revision 7899f917b1c0ea178f1d2be0cfb452086d079d23)
1
2col - filter out reverse line feeds.
3
4Options are:
5	-b	do not print any backspaces (last character written is printed)
6	-f	allow half line feeds in output, by default characters between
7		lines are pushed to the line below
8	-p	force unknown control sequences to be passed through unchanged
9	-x	do not compress spaces into tabs.
10	-l num	keep (at least) num lines in memory, 128 are kept by default
11
12In the 32V source code to col(1) the default behavior was to NOT compress
13spaces into tabs.  There was a -h option which caused it to compress spaces
14into tabs.  There was no -x flag.
15
16The 32V documentation, however, was consistent with the SVID (actually, V7
17at the time) and documented a -x flag (as defined above) while making no
18mention of a -h flag.  Just before 4.3BSD went out, CSRG updated the manual
19page to reflect the way the code worked.  Suspecting that this was probably
20the wrong way to go, this version adopts the SVID defaults, and no longer
21documents the -h option.
22
23Known differences between AT&T's col and this one (# is delimiter):
24	Input			AT&T col		this col
25	#\nabc\E7def\n#		#   def\nabc\r#		#   def\nabc\n#
26	#a#			##			#a\n#
27		- last line always ends with at least one \n (or \E9)
28	#1234567 8\n#		#1234567\t8\n#		#1234567 8\n#
29		- single space not expanded to tab
30     -f #a\E8b\n#		#ab\n#			# b\E9\ra\n#
31		- can back up past first line (as far as you want) so you
32		  *can* have a super script on the first line
33	#\E9_\ba\E8\nb\n#	#\n_\bb\ba\n#		#\n_\ba\bb\n#
34		- always print last character written to a position,
35		  AT&T col claims to do this but doesn't.
36
37If a character is to be placed on a line that has been flushed, a warning
38is produced (the AT&T col is silent).   The -l flag (not in AT&T col) can
39be used to increase the number of lines buffered to avoid the problem.
40
41General algorithm: a limited number of lines are buffered in a linked
42list.  When a printable character is read, it is put in the buffer of
43the current line along with the column it's supposed to be in.  When
44a line is flushed, the characters in the line are sorted according to
45column and then printed.
46