Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > V

vis(1)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

vis, inv — make unprintable and non-ASCII characters in a file visible or invisible

SYNOPSIS

vis [-n] [-s] [-t] [-u] [-x] file ...

inv [-n] [-s] [-t] [-u] [-x] file ...

DESCRIPTION

vis reads characters from each file in sequence and writes them to the standard output, converting those that are not printable or not ASCII into a visible form. inv performs the inverse function, reading printable characters from each file, returning them to non-printable or non-ASCII form, if appropriate, then writing them to standard output;

Non-printable ASCII characters are represented using C-like escape conventions:

\\

backslash

\b

backspace

\e

escape

\f

form-feed

\n

new-line

\r

carriage return

\s

space

\t

horizontal tab

\v

vertical tab

\n

the character whose ASCII code is the 3-digit octal number n.

\xn

the character whose ASCII code is the 2-digit hexadecimal number n.

Non-ASCII single- or multi-byte characters are examined one byte at a time. For each byte, if it can be displayed as an ASCII character, it is treated as if it is an ASCII character; Otherwise, it is represented in the following conventions:

\n

the 8-bit character whose code value is the 3-digit octal number n.

\xn

the 8-bit character whose code value is the 2-digit hexadecimal number n.

Space, horizontal-tab, and new-line characters can be treated as printable (and therefore passed unaltered to the output) or non-printable depending on the options selected. Backslash, although printable, is expanded by vis, to a pair of backslashes so that when they are passed back through inv, they convert back to a single backslash.

If no input file is given, or if the argument - is encountered, vis and inv read from the standard input.

Options

vis and inv recognize the following options:

-n

Treat new-line, space, and horizontal tab as non-printable characters. vis expands them visibly as \n, \s, and \t, rather than passing them directly to the output. inv discards these characters, expecting only the printable expansions. New-line characters are inserted by vis every 16 bytes so that the output will be in a form that is usable by most editors.

-s

Make vis and inv silent about non-existent files, identical input and output, and write errors. Normally, no input file can be the same as the output file unless it is a special file.

-t

Treat horizontal-tab and space characters as non-printable in the same manner that -n treats them.

-u

Cause output to be unbuffered (byte-by-byte); normally, output is buffered.

-x

Cause vis output to be in hexadecimal form rather than the default octal form. Either form is accepted to inv as input.

EXTERNAL INFLUENCES

Environment Variables

LANG determines the language in which messages are displayed.

International Code Set Support

Single- and multi-byte character code sets are supported.

WARNINGS

Redirecting output to an input file destroys the original data. Therefore, command forms such as

vis file1 file2 >file1

should be avoided unless the source file can be safely discarded.

AUTHOR

vis was developed by HP.

SEE ALSO

cat(1), echo(1), od(1).

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.