]> git.ipfire.org Git - thirdparty/util-linux.git/blame - Documentation/col.txt
Merge branch 'PR/libsmartcols-reduce-fix' of github.com:karelzak/util-linux-work
[thirdparty/util-linux.git] / Documentation / col.txt
CommitLineData
6dbe3af9
KZ
1# @(#)README 5.1 (Berkeley) 5/22/90
2
3col - filter out reverse line feeds.
4
6dbe3af9
KZ
5In the 32V source code to col(1) the default behavior was to NOT compress
6spaces into tabs. There was a -h option which caused it to compress spaces
7into tabs. There was no -x flag.
8
9The 32V documentation, however, was consistent with the SVID (actually, V7
10at the time) and documented a -x flag (as defined above) while making no
11mention of a -h flag. Just before 4.3BSD went out, CSRG updated the manual
12page to reflect the way the code worked. Suspecting that this was probably
13the wrong way to go, this version adopts the SVID defaults, and no longer
14documents the -h option.
15
16The S5 -p flag is not supported because it isn't clear what it does (looks
17like a kludge introduced for a particular printer).
18
19Known differences between AT&T's col and this one (# is delimiter):
20 Input AT&T col this col
21 #\nabc\E7def\n# # def\nabc\r# # def\nabc\n#
22 #a# ## #a\n#
23 - last line always ends with at least one \n (or \E9)
24 #1234567 8\n# #1234567\t8\n# #1234567 8\n#
25 - single space not expanded to tab
26 -f #a\E8b\n# #ab\n# # b\E9\ra\n#
27 - can back up past first line (as far as you want) so you
28 *can* have a super script on the first line
29 #\E9_\ba\E8\nb\n# #\n_\bb\ba\n# #\n_\ba\bb\n#
30 - always print last character written to a position,
31 AT&T col claims to do this but doesn't.
32
33If a character is to be placed on a line that has been flushed, a warning
34is produced (the AT&T col is silent). The -l flag (not in AT&T col) can
35be used to increase the number of lines buffered to avoid the problem.
36
37General algorithm: a limited number of lines are buffered in a linked
38list. When a printable character is read, it is put in the buffer of
39the current line along with the column it's supposed to be in. When
40a line is flushed, the characters in the line are sorted according to
41column and then printed.