19b50d902SRodney W. Grimes 29b50d902SRodney W. Grimescol - filter out reverse line feeds. 39b50d902SRodney W. Grimes 49b50d902SRodney W. GrimesOptions are: 59b50d902SRodney W. Grimes -b do not print any backspaces (last character written is printed) 69b50d902SRodney W. Grimes -f allow half line feeds in output, by default characters between 79b50d902SRodney W. Grimes lines are pushed to the line below 8844518ffSMike Heffner -p force unknown control sequences to be passed through unchanged 99b50d902SRodney W. Grimes -x do not compress spaces into tabs. 109b50d902SRodney W. Grimes -l num keep (at least) num lines in memory, 128 are kept by default 119b50d902SRodney W. Grimes 129b50d902SRodney W. GrimesIn the 32V source code to col(1) the default behavior was to NOT compress 139b50d902SRodney W. Grimesspaces into tabs. There was a -h option which caused it to compress spaces 149b50d902SRodney W. Grimesinto tabs. There was no -x flag. 159b50d902SRodney W. Grimes 169b50d902SRodney W. GrimesThe 32V documentation, however, was consistent with the SVID (actually, V7 179b50d902SRodney W. Grimesat the time) and documented a -x flag (as defined above) while making no 189b50d902SRodney W. Grimesmention of a -h flag. Just before 4.3BSD went out, CSRG updated the manual 199b50d902SRodney W. Grimespage to reflect the way the code worked. Suspecting that this was probably 209b50d902SRodney W. Grimesthe wrong way to go, this version adopts the SVID defaults, and no longer 219b50d902SRodney W. Grimesdocuments the -h option. 229b50d902SRodney W. Grimes 239b50d902SRodney W. GrimesKnown differences between AT&T's col and this one (# is delimiter): 249b50d902SRodney W. Grimes Input AT&T col this col 259b50d902SRodney W. Grimes #\nabc\E7def\n# # def\nabc\r# # def\nabc\n# 269b50d902SRodney W. Grimes #a# ## #a\n# 279b50d902SRodney W. Grimes - last line always ends with at least one \n (or \E9) 289b50d902SRodney W. Grimes #1234567 8\n# #1234567\t8\n# #1234567 8\n# 299b50d902SRodney W. Grimes - single space not expanded to tab 309b50d902SRodney W. Grimes -f #a\E8b\n# #ab\n# # b\E9\ra\n# 319b50d902SRodney W. Grimes - can back up past first line (as far as you want) so you 329b50d902SRodney W. Grimes *can* have a super script on the first line 339b50d902SRodney W. Grimes #\E9_\ba\E8\nb\n# #\n_\bb\ba\n# #\n_\ba\bb\n# 349b50d902SRodney W. Grimes - always print last character written to a position, 359b50d902SRodney W. Grimes AT&T col claims to do this but doesn't. 369b50d902SRodney W. Grimes 379b50d902SRodney W. GrimesIf a character is to be placed on a line that has been flushed, a warning 389b50d902SRodney W. Grimesis produced (the AT&T col is silent). The -l flag (not in AT&T col) can 399b50d902SRodney W. Grimesbe used to increase the number of lines buffered to avoid the problem. 409b50d902SRodney W. Grimes 419b50d902SRodney W. GrimesGeneral algorithm: a limited number of lines are buffered in a linked 429b50d902SRodney W. Grimeslist. When a printable character is read, it is put in the buffer of 439b50d902SRodney W. Grimesthe current line along with the column it's supposed to be in. When 449b50d902SRodney W. Grimesa line is flushed, the characters in the line are sorted according to 459b50d902SRodney W. Grimescolumn and then printed. 46