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