cat(1)
_________________________________________________________________
cat Command
concatenate and type files to standard output
_________________________________________________________________
SYNTAX
cat [ -u ] [ -s ] [ -v [-t] [-e] ] file ...
DESCRIPTION
Cat reads each file (from left to right) and writes it on the
standard output. Thus:
cat file
prints the file on the screen, and:
cat file1 file2 >file3
concatenates the first two files and places the result on the
third.
If no input file is given, or if the argument - is encountered,
cat reads from the standard input file.
Options are:
-u Unbuffered output. The output is buffered unless you give
this option.
-s Be silent about non-existent files; no error message is
given.
-v Visible printing of nonprinting characters (except tabs,
newlines and form-feeds). Control characters are printed
^X (control-x); the DEL character (octal 0177) is printed
^?. Non-ASCII characters (with the high bit set) are
printed as M-x, where x is the character specified by the
seven low-order bits. The option -v must be present for
the -t and -e switches to work.
-t Print tabs as ^I's, but only if the -v switch is also
present. Otherwise, it is ignored.
-e Print a $ character at the end of each line (prior to the
newline), but only if the -v switch is also invoked.
Otherwise, it is ignored.
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
cat(1)
_________________________________________________________________
EXAMPLES
$ cat file1
The
quick
brown
fox
$ cat file2
jumped
over
the
lazy
dog.
$ cat file1 file2 > file3
$ cat file3
The
quick
brown
fox
jumped
over
the
lazy
dog.
The above example shows the concatenation of two different files
into one file.
_________________________________________________________________
HINTS
When the standard input is the keyboard and the standard output
is the screen, cat prints back each line as you enter it (the
newline character and all other special characters cannot be
escaped. Cat does not interpret characters).
Using cat >file1 is a good way to create short files quickly.
Type ^d (control-d) to end input to the file.
WARNING
Sh(1) creates and/or opens the files for the output of the cat
command before reading the files for its input. Therefore,
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)
cat(1)
command formats such as
cat file1 file2 >file1
will cause the original data in file1 to be lost; take care when
using the shell special characters to specify files for cat to
use.
SEE ALSO
cp(1), head(1), more(1), pg(1), pr(1), tail(1).
DG/UX 4.00 Page 3
Licensed material--property of copyright holder(s)