HP-UX Reference (11i v2 04/09) - 1 User Commands A-M (vol 1)

c
cat(1) cat(1)
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
Exit values are:
0 Successful completion.
>0 Error condition occurred.
EXAMPLES
To create a zero-length file, use any of the following:
cat /dev/null
> file
cp /dev/null file
touch file
The following prints
ˆI for all the occurrences of tab character in file1
cat -t file1
To suppress error messages about files that do not exist, use:
cat -s file1 file2 file3
> file
If file2 does not exist, the above command concatenates file1 and file3 without reporting the error on file2.
The result is the same if
-s option is not used, except that cat displays the error message.
To view non-printable characters in file2, use:
cat -v file2
WARNINGS
Command formats such as
cat file1 file2 > file1
overwrites the data in file1 before the concatenation begins, thus destroying the file. Therefore, be care-
ful when using shell special characters.
SEE ALSO
cp(1), more(1), pg(1), pr(1), rmnl(1), ssp(1).
STANDARDS CONFORMANCE
cat: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
Section 1−−66 Hewlett-Packard Company − 2 − HP-UX 11i Version 2: September 2004