c

cat(1)

cat(1)

NAME

cat - concatenate, copy, and print ®les

SYNOPSIS

cat [-benrstuv]®le ...

DESCRIPTION

cat reads each ®le in sequence and writes it on the standard output. Thus:

cat ®le

prints ®le on the default standard output device;

cat ®le1 ®le2 > ®le3

concatenates ®le1 and ®le2, and places the result in ®le3.

If - is appears as a ®le argument, cat uses standard input. To combine standard input and other ®les, use a combination of - and ®le arguments.

Options

cat recognizes the following options:

-bOmit line numbers from blank lines when -noption is speci®ed. If this option is speci®ed, the -noption is automatically selected.

-ePrint a $ character at the end of each line (prior to the new-line). If this option is speci®ed, the -voption is automatically selected.

-nDisplay output lines preceded by line numbers, numbered sequentially from 1.

-rReplace multiple consecutive empty lines with one empty line, so that there is never more than one empty line between lines containing characters.

-sSilent option. cat suppresses error messages about non-existent ®les, identical input and out- put, and write errors. Normally, input and output ®les cannot have identical names unless the ®le is a special ®le.

-tPrint each tab character as ÃI and form feed character as ÃL. If this option is speci®ed, the -voption is automatically selected.

-uDo not buffer output (handle character-by-character). Normally, output is buffered.

-vCause non-printing characters (with the exception of tabs, new-lines and form-feeds) to be printed visibly. Control characters are printed using the form ÃX (Ctrl-X), and the DEL character (octal 0177) is printed as Ã? (see ascii(5)). Single-byte control characters whose most signi®cant bit is set, are printed using the form M-Ãx, where x is the character speci®ed by the seven low order bits. All other non-printing characters are printed as M-x, where x is the character speci®ed by the seven low order bits. This option is in¯uenced by the LC_CTYPE environment variable and its corresponding code set.

EXTERNAL INFLUENCES

Environment Variables

LANG provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the default value of "C" (see lang(5)) is used. If any of the internationalization variables contains an invalid setting, cat will behave as if all internationalization variables are set to "C". See environ(5).

LC_ALL If set to a non-empty string value, overrides the values of all the other internationalization vari- ables.

LC_CTYPE determines the interpretation of text as single and/or multi-byte characters, the classi®cation of characters as printable, and the characters matched by character class expressions in regular expres- sions.

LC_MESSAGES determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error and informative messages written to standard output.

NLSPATH determines the location of message catalogues for the processing of LC_MESSAGES .

Section 160

− 1 −

HP-UX Release 11i: December 2000