Module Name:src
Committed By: christos
Date: Sun Nov 1 22:27:15 UTC 2020
Modified Files:
src/usr.bin/col: Makefile col.1 col.c
Log Message:
Replace col with the FreeBSD version that adds wide char support
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/col/Makefile
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/col/col.1
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/col/col.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/col/Makefile
diff -u src/usr.bin/col/Makefile:1.5 src/usr.bin/col/Makefile:1.6
--- src/usr.bin/col/Makefile:1.5 Tue Apr 14 18:15:18 2009
+++ src/usr.bin/col/Makefile Sun Nov 1 17:27:15 2020
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.5 2009/04/14 22:15:18 lukem Exp $
+# $NetBSD: Makefile,v 1.6 2020/11/01 22:27:15 christos Exp $
# @(#)Makefile 8.1 (Berkeley) 6/6/93
+WARNS=6
PROG= col
.include
Index: src/usr.bin/col/col.1
diff -u src/usr.bin/col/col.1:1.10 src/usr.bin/col/col.1:1.11
--- src/usr.bin/col/col.1:1.10 Thu Mar 22 03:58:18 2012
+++ src/usr.bin/col/col.1 Sun Nov 1 17:27:15 2020
@@ -1,5 +1,4 @@
-.\" $NetBSD: col.1,v 1.10 2012/03/22 07:58:18 wiz Exp $
-.\"
+.\" $NetBSD: col.1,v 1.11 2020/11/01 22:27:15 christos Exp $
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -31,8 +30,9 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)col.1 8.1 (Berkeley) 6/29/93
+.\" $FreeBSD: head/usr.bin/col/col.1 366913 2020-10-21 16:30:34Z fernape $
.\"
-.Dd February 22, 1999
+.Dd November 1, 2020
.Dt COL 1
.Os
.Sh NAME
@@ -40,23 +40,21 @@
.Nd filter reverse line feeds from input
.Sh SYNOPSIS
.Nm
-.Op Fl bfpx
+.Op Fl bfhpx
.Op Fl l Ar num
.Sh DESCRIPTION
+The
.Nm
-filters out reverse (and half reverse) line feeds so that the output is
+utility filters out reverse (and half reverse) line feeds so that the output is
in the correct order with only forward and half forward line
feeds, and replaces white-space characters with tabs where possible.
-This can be useful in processing the output of
-.Xr nroff 1
-and
-.Xr tbl 1 .
.Pp
+The
.Nm
-reads from the standard input and writes to the standard output.
+utility reads from the standard input and writes to the standard output.
.Pp
The options are as follows:
-.Bl -tag -width "-l num "
+.Bl -tag -width indent
.It Fl b
Do not output any backspaces, printing only the last character
written to each column position.
@@ -64,6 +62,13 @@ written to each column position.
Forward half line feeds are permitted (``fine'' mode).
Normally characters printed on a half line boundary are printed
on the following line.
+.It Fl h
+Do not output multiple spaces instead of tabs (default).
+.It Fl l Ar num
+Buffer at least
+.Ar num
+lines in memory.
+By default, 128 lines are buffered.
.It Fl p
Force unknown control sequences to be passed through unchanged.
Normally,
@@ -72,25 +77,35 @@ will filter out any control sequences fr
recognized and interpreted by itself, which are listed below.
.It Fl x
Output multiple spaces instead of tabs.
-.It Fl l Ar num
-Buffer at least
-.Ar num
-lines in memory.
-By default, 128 lines are buffered.
.El
.Pp
-The control sequences for carriage motion that
+In the input stream,
.Nm
-understands and their decimal values are listed in the following
-table:
+understands both the escape sequences of the form escape-digit
+mandated by
+.St -susv2
+and the traditional
+.Bx
+format escape-control-character.
+The control sequences for carriage motion and their ASCII values
+are as follows:
.Pp
.Bl -tag -width "carriage return" -compact
+.It ESC\-BELL
+reverse line feed (escape then bell).
.It ESC\-7
-reverse line feed (escape then 7)
+reverse line feed (escape then 7).
+.It ESC\-BACKSPACE
+half reverse line feed (escape then backspace).
.It ESC\-8
-half reverse line feed (escape then 8)
+half reverse line feed (escape then 8).
+.It ESC\-TAB
+half forward line feed (escape than tab).
.It ESC\-9
-half forward line feed (escape then 9)
+half forward line feed (escape then 9).
+In
+.Fl f
+mode, this sequence may also occur in the output stream.
.It backspace
moves back one column (8); ignored in the first column
.It carriage return
@@ -100,7 +115,7 @@ forward line feed (10); also does carria
.It shift in
shift to normal character set (15)
.It shift out
-shift to alternative character set (14)
+shift to alternate character set (14)
.It space
moves forward one column (32)
.It tab
@@ -112,27 +127,46 @@ reverse line feed (11)
All unrecognized control characters and escape sequences are
discarded.
.Pp
+The
.Nm
-keeps track of the character set as characters are read and makes
+utility keeps track of the character set as characters are read and makes
sure the character set is correct when they are output.
.Pp
If the input attempts to back up to the last flushed line,
.Nm
will display a warning message.
+.Sh ENVIRONMENT