xref: /original-bsd/usr.bin/vis/vis.1 (revision 5e1b3b90)
Copyright (c) 1989 The Regents of the University of California.
All rights reserved.

Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by the University of California, Berkeley. The name of the
University may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

@(#)vis.1 1.1 (Berkeley) 05/15/90

<VIS> <1> ""
C 7
NAME
vis - display non-printable characters in a visual format
SYNOPSIS
vis [ -nwcgoifsh ] [ -F foldwidth ] [ file ... ]
DESCRIPTION
Vis is a filter for converting non-printable characters into a visual representation. It differs from cat -v in that the form is unique and invertible. A detailed description of the various visual formats is given in cencode(3).
OPTIONS
The c, g, and o flags select a particular display format. All three can be requested independent of each other, since two of them only operate on a subset of the non-printable characters.
-c
Request a format which displays a small subset of the non-printable characters using C-style backslash sequences.
-g
Request a format which displays non-printable characters using a \\^C notation for control characters, and \\M notation for meta characters (chars with the 8th bit set). All non-printables, except space and meta-space when using the -w flag, can be encoded using this format.
-o
Request a format which displays non-printable characters as an octal number, \\ddd. All non-printable characters can be displayed using this format.
-w
Normally vis considers white space (space-tab-newline) as printable. The -w flag causes white space to be encoded in a visual form.
-i
Causes vis to invert visually encoded data back to its original form. When using -i, it is unnecessary to select an encoding format, since all formats are unique and invertible.
-f
and
-F
Causes vis to fold output lines to foldwidth columns (default 80), like fold(1), except that a hidden newline sequence is used, which is removed when inverting the file back to its original form with -i. If the last character in the encoded file does not end in a newline, vis automatically appends a hidden newline to the end. This makes various editors and other utilities happy.
-s
Causes vis to strip the 8th bit on all characters. This obviously produces non-invertible output.
-n
Normally, if none of -c, -g, or -o are selected, vis turns on all three flags. The -n flag forces vis to disable any encoding, except for backslash stuffing and line length folding.
-h
When using -i to invert data, this causes vis to treat the hat (^) as a special character all the time (normally, all visual sequences are preceded by a backslash). This option is provided for compatibility with the common convention that ^C introduces a control character sequence; however, the new invertible sequence, \\^C, is recommended as the preferred representation.
"SEE ALSO
cencode(3)