xref: /netbsd-src/usr.bin/col/README (revision 4c5b39eb101c9158259ae50c3cf4ff6a517d908e)
1*4c5b39ebSglass#	@(#)README	8.1 (Berkeley) 6/6/93
261f28255Scgd
361f28255Scgdcol - filter out reverse line feeds.
461f28255Scgd
561f28255ScgdOptions are:
661f28255Scgd	-b	do not print any backspaces (last character written is printed)
761f28255Scgd	-f	allow half line feeds in output, by default characters between
861f28255Scgd		lines are pushed to the line below
961f28255Scgd	-x	do not compress spaces into tabs.
1061f28255Scgd	-l num	keep (at least) num lines in memory, 128 are kept by default
1161f28255Scgd
1261f28255ScgdIn the 32V source code to col(1) the default behavior was to NOT compress
1361f28255Scgdspaces into tabs.  There was a -h option which caused it to compress spaces
1461f28255Scgdinto tabs.  There was no -x flag.
1561f28255Scgd
1661f28255ScgdThe 32V documentation, however, was consistent with the SVID (actually, V7
1761f28255Scgdat the time) and documented a -x flag (as defined above) while making no
1861f28255Scgdmention of a -h flag.  Just before 4.3BSD went out, CSRG updated the manual
1961f28255Scgdpage to reflect the way the code worked.  Suspecting that this was probably
2061f28255Scgdthe wrong way to go, this version adopts the SVID defaults, and no longer
2161f28255Scgddocuments the -h option.
2261f28255Scgd
2361f28255ScgdThe S5 -p flag is not supported because it isn't clear what it does (looks
2461f28255Scgdlike a kludge introduced for a particular printer).
2561f28255Scgd
2661f28255ScgdKnown differences between AT&T's col and this one (# is delimiter):
2761f28255Scgd	Input			AT&T col		this col
2861f28255Scgd	#\nabc\E7def\n#		#   def\nabc\r#		#   def\nabc\n#
2961f28255Scgd	#a#			##			#a\n#
3061f28255Scgd		- last line always ends with at least one \n (or \E9)
3161f28255Scgd	#1234567 8\n#		#1234567\t8\n#		#1234567 8\n#
3261f28255Scgd		- single space not expanded to tab
3361f28255Scgd     -f #a\E8b\n#		#ab\n#			# b\E9\ra\n#
3461f28255Scgd		- can back up past first line (as far as you want) so you
3561f28255Scgd		  *can* have a super script on the first line
3661f28255Scgd	#\E9_\ba\E8\nb\n#	#\n_\bb\ba\n#		#\n_\ba\bb\n#
3761f28255Scgd		- always print last character written to a position,
3861f28255Scgd		  AT&T col claims to do this but doesn't.
3961f28255Scgd
4061f28255ScgdIf a character is to be placed on a line that has been flushed, a warning
4161f28255Scgdis produced (the AT&T col is silent).   The -l flag (not in AT&T col) can
4261f28255Scgdbe used to increase the number of lines buffered to avoid the problem.
4361f28255Scgd
4461f28255ScgdGeneral algorithm: a limited number of lines are buffered in a linked
4561f28255Scgdlist.  When a printable character is read, it is put in the buffer of
4661f28255Scgdthe current line along with the column it's supposed to be in.  When
4761f28255Scgda line is flushed, the characters in the line are sorted according to
4861f28255Scgdcolumn and then printed.
49