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