San Diego State University logo

*Technical Briefs*
ROHAN help Files

----------------------------------------------------------------------

cat

cat means concatenate. That is, concatenate (join) two objects together. By default, the keyboard is connected to the input of the cat program. Information that is typed on-screen can be read by cat and redirected from the keyboard to a file using the redirect metacharacter, >. Syntax is:

rohan%cat  >  filename

The system clears the screen to indicate you are in the cat program. Data entered from the keyboard and followed with a CTRL-D to indicate the end of the file will be redirected to the filename you have specified.

The program can concatenate multiple files. Syntax is:

rohan%cat  file1  file2  file3  >  outputfile

where file1, file2, and file3 are the names of the source files you wish to join together into one destination file named outputfile. cat lists the first file, then the second file, and then the third file into the destination file. If the files are more than one screen of data, the system will rapidly scroll information and display only the last full screen of your files. To alter this, pipe the output of cat to a pagination program (See the more help file). Syntax is:

rohan%cat  file1  file2  file3  >  outputfile  |  more

Be careful when you use the redirect metacharacter, >, with the cat program. If the destination filename you are redirecting to exists, cat erases its contents and replaces the destination file with the contents of the source file(s).

----------------------------------------------------------------------


BACK ROHAN Help Index | Academic Computing Handouts, Manuals, and Help Files

This page last modified: December 11, 2002
Send comments/suggestions about this web page to webmaster@rohan.sdsu.edu

SDSU Faculty and Students may send questions about software on ROHAN or ROHAN UNIX problems to problems@rohan.sdsu.edu