xref: /original-bsd/usr.bin/vis/vis.1 (revision c3e32dec)
1.\" Copyright (c) 1989, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"     @(#)vis.1	8.1 (Berkeley) 06/06/93
7.\"
8.Dd
9.Dt VIS 1
10.Os BSD 4.4
11.Sh NAME
12.Nm vis
13.Nd display non-printable characters in a visual format
14.Sh SYNOPSIS
15.Nm vis
16.Op Fl cbflnostw
17.Op Fl F Ar foldwidth
18.Op Ar file ...
19.Sh DESCRIPTION
20.Nm Vis
21is a filter for converting non-printable characters
22into a visual representation.  It differs from
23.Ql cat -v
24in that
25the form is unique and invertible.  By default, all non-graphic
26characters except space, tab, and newline are encoded.
27A detailed description of the
28various visual formats is given in
29.Xr vis 3 .
30.Pp
31Options supported by
32.Nm vis :
33.Bl -tag -width Ds
34.It Fl b
35Turns off prepending of backslash before up-arrow control sequences
36and meta characters, and disables the doubling of backslashes.  This
37produces output which is neither invertible or precise, but does
38represent a minimum of change to the input.  It is similar to
39.Dq Li cat -v .
40.It Fl c
41Request a format which displays a small subset of the
42non-printable characters using C-style backslash sequences.
43.It Fl F
44Causes
45.Nm vis
46to fold output lines to foldwidth columns (default 80), like
47.Xr fold 1 ,
48except
49that a hidden newline sequence is used, (which is removed
50when inverting the file back to its original form with
51.Xr unvis 1 ) .
52If the last character in the encoded file does not end in a newline,
53a hidden newline sequence is appended to the output.
54This makes
55the output usuable with various editors and other utilities which
56typically don't work with partial lines.
57.It Fl f
58Same as
59.Fl F .
60.It Fl l
61Mark newlines with the visable sequence
62.Ql \e$ ,
63followed by the newline.
64.It Fl n
65Turns off any encoding, except for the fact that backslashes are
66still doubled and hidden newline sequences inserted if
67.Fl f
68or
69.Fl F
70is selected.  When combined with the
71.Fl f
72flag,
73.Nm vis
74becomes like
75an invertible version of the
76.Xr fold 1
77utility.  That is, the output
78can be unfolded by running the output through
79.It Fl o
80Request a format which displays non-printable characters as
81an octal number, \eddd.
82.It Fl s
83Only characters considered unsafe to send to a terminal are encoded.
84This flag allows backspace, bell, and carriage return in addition
85to the default space, tab and newline.
86.Xr unvis 1 .
87.It Fl t
88Tabs are also encoded.
89.It Fl w
90White space (space-tab-newline) is also encoded.
91.El
92.Sh SEE ALSO
93.Xr unvis 1
94.Xr vis 3
95.Sh HISTORY
96The
97.Nm
98command appears in
99.Bx 4.4 .
100