xref: /netbsd/usr.bin/vis/vis.1 (revision c4a72b64)
1.\"	$NetBSD: vis.1,v 1.9 2002/09/30 11:09:16 grant Exp $
2.\"
3.\" Copyright (c) 1989, 1991, 1993, 1994
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     @(#)vis.1	8.4 (Berkeley) 4/19/94
35.\"
36.Dd April 19, 1994
37.Dt VIS 1
38.Os
39.Sh NAME
40.Nm vis
41.Nd display non-printable characters in a visual format
42.Sh SYNOPSIS
43.Nm
44.Op Fl cbflnostw
45.Op Fl F Ar foldwidth
46.Op Ar file ...
47.Sh DESCRIPTION
48.Nm
49is a filter for converting non-printable characters
50into a visual representation.
51It differs from
52.Ql cat -v
53in that
54the form is unique and invertible.
55By default, all non-graphic
56characters except space, tab, and newline are encoded.
57A detailed description of the
58various visual formats is given in
59.Xr vis 3 .
60.Pp
61The options are as follows:
62.Bl -tag -width Ds
63.It Fl b
64Turns off prepending of backslash before up-arrow control sequences
65and meta characters, and disables the doubling of backslashes.
66This
67produces output which is neither invertible or precise, but does
68represent a minimum of change to the input.
69It is similar to
70.Dq Li cat -v .
71.It Fl c
72Request a format which displays a small subset of the
73non-printable characters using C-style backslash sequences.
74.It Fl F
75Causes
76.Nm
77to fold output lines to foldwidth columns (default 80), like
78.Xr fold 1 ,
79except
80that a hidden newline sequence is used, (which is removed
81when inverting the file back to its original form with
82.Xr unvis 1 ) .
83If the last character in the encoded file does not end in a newline,
84a hidden newline sequence is appended to the output.
85This makes
86the output usable with various editors and other utilities which
87typically don't work with partial lines.
88.It Fl f
89Same as
90.Fl F .
91.It Fl l
92Mark newlines with the visible sequence
93.Ql \e$ ,
94followed by the newline.
95.It Fl n
96Turns off any encoding, except for the fact that backslashes are
97still doubled and hidden newline sequences inserted if
98.Fl f
99or
100.Fl F
101is selected.
102When combined with the
103.Fl f
104flag,
105.Nm
106becomes like
107an invertible version of the
108.Xr fold 1
109utility.
110That is, the output can be unfolded by running the output through
111.Xr unvis 1 .
112.It Fl o
113Request a format which displays non-printable characters as
114an octal number, \eddd.
115.It Fl s
116Only characters considered unsafe to send to a terminal are encoded.
117This flag allows backspace, bell, and carriage return in addition
118to the default space, tab and newline.
119.It Fl t
120Tabs are also encoded.
121.It Fl w
122White space (space-tab-newline) is also encoded.
123.El
124.Sh SEE ALSO
125.Xr unvis 1 ,
126.Xr vis 3
127.Sh HISTORY
128The
129.Nm
130command appears in
131.Bx 4.4 .
132