xref: /minix3/usr.bin/vis/vis.1 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc.\"	$NetBSD: vis.1,v 1.23 2015/05/24 19:42:39 christos Exp $
206f01a55SThomas Cort.\"
306f01a55SThomas Cort.\" Copyright (c) 1989, 1991, 1993, 1994
406f01a55SThomas Cort.\"	The Regents of the University of California.  All rights reserved.
506f01a55SThomas Cort.\"
606f01a55SThomas Cort.\" Redistribution and use in source and binary forms, with or without
706f01a55SThomas Cort.\" modification, are permitted provided that the following conditions
806f01a55SThomas Cort.\" are met:
906f01a55SThomas Cort.\" 1. Redistributions of source code must retain the above copyright
1006f01a55SThomas Cort.\"    notice, this list of conditions and the following disclaimer.
1106f01a55SThomas Cort.\" 2. Redistributions in binary form must reproduce the above copyright
1206f01a55SThomas Cort.\"    notice, this list of conditions and the following disclaimer in the
1306f01a55SThomas Cort.\"    documentation and/or other materials provided with the distribution.
1406f01a55SThomas Cort.\" 3. Neither the name of the University nor the names of its contributors
1506f01a55SThomas Cort.\"    may be used to endorse or promote products derived from this software
1606f01a55SThomas Cort.\"    without specific prior written permission.
1706f01a55SThomas Cort.\"
1806f01a55SThomas Cort.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1906f01a55SThomas Cort.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2006f01a55SThomas Cort.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2106f01a55SThomas Cort.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2206f01a55SThomas Cort.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2306f01a55SThomas Cort.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2406f01a55SThomas Cort.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2506f01a55SThomas Cort.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2606f01a55SThomas Cort.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2706f01a55SThomas Cort.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2806f01a55SThomas Cort.\" SUCH DAMAGE.
2906f01a55SThomas Cort.\"
3006f01a55SThomas Cort.\"     @(#)vis.1	8.4 (Berkeley) 4/19/94
3106f01a55SThomas Cort.\"
32*0a6a1f1dSLionel Sambuc.Dd May 24, 2015
3306f01a55SThomas Cort.Dt VIS 1
3406f01a55SThomas Cort.Os
3506f01a55SThomas Cort.Sh NAME
3606f01a55SThomas Cort.Nm vis
3706f01a55SThomas Cort.Nd display non-printable characters in a visual format
3806f01a55SThomas Cort.Sh SYNOPSIS
3906f01a55SThomas Cort.Nm
40*0a6a1f1dSLionel Sambuc.Op Fl bcfhlMmNnoSstw
4106f01a55SThomas Cort.Op Fl e Ar extra
4206f01a55SThomas Cort.Op Fl F Ar foldwidth
4306f01a55SThomas Cort.Op Ar file ...
4406f01a55SThomas Cort.Sh DESCRIPTION
4506f01a55SThomas Cort.Nm
4606f01a55SThomas Cortis a filter for converting non-printable characters
4706f01a55SThomas Cortinto a visual representation.
4806f01a55SThomas CortIt differs from
4906f01a55SThomas Cort.Ql cat -v
5006f01a55SThomas Cortin that
5106f01a55SThomas Cortthe form is unique and invertible.
5206f01a55SThomas CortBy default, all non-graphic
5306f01a55SThomas Cortcharacters except space, tab, and newline are encoded.
5406f01a55SThomas CortA detailed description of the
5506f01a55SThomas Cortvarious visual formats is given in
5606f01a55SThomas Cort.Xr vis 3 .
5706f01a55SThomas Cort.Pp
5806f01a55SThomas CortThe options are as follows:
5906f01a55SThomas Cort.Bl -tag -width Ds
6006f01a55SThomas Cort.It Fl b
6106f01a55SThomas CortTurns off prepending of backslash before up-arrow control sequences
6206f01a55SThomas Cortand meta characters, and disables the doubling of backslashes.
6306f01a55SThomas CortThis
6406f01a55SThomas Cortproduces output which is neither invertible or precise, but does
6506f01a55SThomas Cortrepresent a minimum of change to the input.
6606f01a55SThomas CortIt is similar to
6706f01a55SThomas Cort.Dq Li cat -v .
6806f01a55SThomas Cort.Pq Dv VIS_NOSLASH
6906f01a55SThomas Cort.It Fl c
7006f01a55SThomas CortRequest a format which displays a small subset of the
7106f01a55SThomas Cortnon-printable characters using C-style backslash sequences.
7206f01a55SThomas Cort.Pq Dv VIS_CSTYLE
7306f01a55SThomas Cort.It Fl e Ar extra
7406f01a55SThomas CortAlso encode characters in
7506f01a55SThomas Cort.Ar extra ,
7606f01a55SThomas Cortper
7706f01a55SThomas Cort.Xr svis 3 .
7806f01a55SThomas Cort.It Fl F Ar foldwidth
7906f01a55SThomas CortCauses
8006f01a55SThomas Cort.Nm
8106f01a55SThomas Cortto fold output lines to foldwidth columns (default 80), like
8206f01a55SThomas Cort.Xr fold 1 ,
8306f01a55SThomas Cortexcept
8406f01a55SThomas Cortthat a hidden newline sequence is used, (which is removed
8506f01a55SThomas Cortwhen inverting the file back to its original form with
8606f01a55SThomas Cort.Xr unvis 1 ) .
8706f01a55SThomas CortIf the last character in the encoded file does not end in a newline,
8806f01a55SThomas Corta hidden newline sequence is appended to the output.
8906f01a55SThomas CortThis makes
9006f01a55SThomas Cortthe output usable with various editors and other utilities which
9106f01a55SThomas Corttypically don't work with partial lines.
9206f01a55SThomas Cort.It Fl f
9306f01a55SThomas CortSame as
9406f01a55SThomas Cort.Fl F .
9506f01a55SThomas Cort.It Fl h
9606f01a55SThomas CortEncode using the URI encoding from RFC 1808.
9706f01a55SThomas Cort.Pq Dv VIS_HTTPSTYLE
9806f01a55SThomas Cort.It Fl l
9906f01a55SThomas CortMark newlines with the visible sequence
10006f01a55SThomas Cort.Ql \e$ ,
10106f01a55SThomas Cortfollowed by the newline.
102*0a6a1f1dSLionel Sambuc.It Fl M
103*0a6a1f1dSLionel SambucEncode all shell meta characters (implies
104*0a6a1f1dSLionel Sambuc.Fl S ,
105*0a6a1f1dSLionel Sambuc.Fl w ,
106*0a6a1f1dSLionel Sambuc.Fl g )
107*0a6a1f1dSLionel Sambuc.Pq Dv VIS_META
10806f01a55SThomas Cort.It Fl m
10906f01a55SThomas CortEncode using the MIME Quoted-Printable encoding from RFC 2045.
11006f01a55SThomas Cort.Pq Dv VIS_MIMESTYLE
111*0a6a1f1dSLionel Sambuc.It Fl N
112*0a6a1f1dSLionel SambucTurn on the
113*0a6a1f1dSLionel Sambuc.Dv VIS_NOLOCALE
114*0a6a1f1dSLionel Sambucflag which encodes using the
115*0a6a1f1dSLionel Sambuc.Dq C
116*0a6a1f1dSLionel Sambuclocale, removing any encoding dependencies caused by the current
117*0a6a1f1dSLionel Sambuclocale settings specified in the environment.
11806f01a55SThomas Cort.It Fl n
11906f01a55SThomas CortTurns off any encoding, except for the fact that backslashes are
12006f01a55SThomas Cortstill doubled and hidden newline sequences inserted if
12106f01a55SThomas Cort.Fl f
12206f01a55SThomas Cortor
12306f01a55SThomas Cort.Fl F
12406f01a55SThomas Cortis selected.
12506f01a55SThomas CortWhen combined with the
12606f01a55SThomas Cort.Fl f
12706f01a55SThomas Cortflag,
12806f01a55SThomas Cort.Nm
12906f01a55SThomas Cortbecomes like
13006f01a55SThomas Cortan invertible version of the
13106f01a55SThomas Cort.Xr fold 1
13206f01a55SThomas Cortutility.
13306f01a55SThomas CortThat is, the output can be unfolded by running the output through
13406f01a55SThomas Cort.Xr unvis 1 .
13506f01a55SThomas Cort.It Fl o
13606f01a55SThomas CortRequest a format which displays non-printable characters as
13706f01a55SThomas Cortan octal number, \eddd.
13806f01a55SThomas Cort.Pq Dv VIS_OCTAL
139*0a6a1f1dSLionel Sambuc.It Fl S
140*0a6a1f1dSLionel SambucEncode shell meta-characters that are non-white space or glob.
141*0a6a1f1dSLionel Sambuc.Pq Dv VIS_SHELL
14206f01a55SThomas Cort.It Fl s
14306f01a55SThomas CortOnly characters considered unsafe to send to a terminal are encoded.
14406f01a55SThomas CortThis flag allows backspace, bell, and carriage return in addition
14506f01a55SThomas Cortto the default space, tab and newline.
14606f01a55SThomas Cort.Pq Dv VIS_SAFE
14706f01a55SThomas Cort.It Fl t
14806f01a55SThomas CortTabs are also encoded.
14906f01a55SThomas Cort.Pq Dv VIS_TAB
15006f01a55SThomas Cort.It Fl w
15106f01a55SThomas CortWhite space (space-tab-newline) is also encoded.
15206f01a55SThomas Cort.Pq Dv VIS_WHITE
15306f01a55SThomas Cort.El
15484d9c625SLionel Sambuc.Sh MULTIBYTE CHARACTER SUPPORT
15584d9c625SLionel Sambuc.Nm
15684d9c625SLionel Sambucsupports multibyte character input.
15784d9c625SLionel SambucThe encoding conversion is influenced by the setting of the
15884d9c625SLionel Sambuc.Ev LC_CTYPE
15984d9c625SLionel Sambucenvironment variable which defines the set of characters that can be
16084d9c625SLionel Sambuccopied without encoding.
16184d9c625SLionel Sambuc.Pp
16284d9c625SLionel SambucWhen 8-bit data is present in the input,
16384d9c625SLionel Sambuc.Ev LC_CTYPE
16484d9c625SLionel Sambucmust be set to the correct locale or to the C locale.
16584d9c625SLionel SambucIf the locales of the data and the conversion are mismatched, multibyte
16684d9c625SLionel Sambuccharacter recognition may fail and encoding will be performed byte-by-byte
16784d9c625SLionel Sambucinstead.
16884d9c625SLionel Sambuc.Sh ENVIRONMENT
16984d9c625SLionel Sambuc.Bl -tag -width ".Ev LC_CTYPE"
17084d9c625SLionel Sambuc.It Ev LC_CTYPE
17184d9c625SLionel SambucSpecify the locale of the input data.
17284d9c625SLionel SambucSet to C if the input data locale is unknown.
17384d9c625SLionel Sambuc.El
17406f01a55SThomas Cort.Sh SEE ALSO
17506f01a55SThomas Cort.Xr unvis 1 ,
17606f01a55SThomas Cort.Xr svis 3 ,
17706f01a55SThomas Cort.Xr vis 3
17806f01a55SThomas Cort.Sh HISTORY
17906f01a55SThomas CortThe
18006f01a55SThomas Cort.Nm
18106f01a55SThomas Cortcommand appears in
18206f01a55SThomas Cort.Bx 4.4 .
18384d9c625SLionel SambucMultibyte character support was added in
18484d9c625SLionel Sambuc.Nx 7.0
18584d9c625SLionel Sambucand
18684d9c625SLionel Sambuc.Fx 9.2 .
187