Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site noscvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!harpo!decvax!ittvax!dcdwest!sdcsvax!noscvax!kemp From: kemp@noscvax.UUCP Newsgroups: net.unix Subject: examples of cat Message-ID: <462@noscvax.UUCP> Date: Wed, 16-May-84 09:18:23 EDT Article-I.D.: noscvax.462 Posted: Wed May 16 09:18:23 1984 Date-Received: Thu, 17-May-84 04:22:53 EDT Organization: Naval Ocean Systems Center Lines: 29 -a non-blank line- Here are five examples of using cat on a 4.2bsd system. Does anyone have comments? % cat filename lists the entire contents of filename at the terminal. % cat -n filename > outfile copies the contents of file 'filename' into 'outfile'. The -n causes line numbers to appear in the output file. % cat file1 file2 >file3 concatenates the first two files and places the result on the third. CAVEAT: Beware of 'cat a b >a' and 'cat a b >b' which destroy the input files BEFORE reading them. % cat -v printfile lists as above, but causes 'non-printing' characters to be listed in a visible way. % cat - x - y > z will A: accept input from the terminal until a ^D and store it in file "z" B: list the contents of file "x" and append it to file "z" C: accept input from the terminal until a ^D and append it to file "z" D: list the contents of file "y" and append it to file "z" The net effect is to interleave keyins and files together! - - - - - - * - - - - - -