Team-FLY |
4.10 Exercise: A cat UtilityThe cat utility has the following POSIX specification[52]. NAME cat - concatenate and print files SYNOPSIS cat [-u] [file ...] DESCRIPTION The cat utility shall read files in sequence and shall write their contents to the standard output in the same sequence. OPTIONS The cat utility shall conform to the Base Definitions volume of IEEE STd 1003.1-2001, Section 12.2, Utility Syntax Guidelines. The following option shall be supported: -u Write bytes from the input file to the standard output without delay as each is read OPERANDS The following operand shall be supported: file A pathname of an input file. If no file operands are specified, the standard input shall be used. If a file is '-', the cat utility shall read from the standard input at that point in the sequence. The cat utility shall not close and reopen standard input when it is referenced in this way, but shall accept multiple occurrences of '-' as a file operand. STDIN The standard input shall be used only if no file operands are specified, or if a file operand is '-'. See the INPUT FILES section. INPUT FILES The input files can be any file type. ENVIRONMENT VARIABLES (.... a long section omitted here ....) ASYNCHRONOUS EVENTS Default. STDOUT The standard output shall contain the sequence of bytes read from the input files. Nothing else shall be written to the standard output. STDERR The standard error shall be used only for diagnostic messages. OUTPUT FILES None. EXTENDED DESCRIPTION None. EXIT STATUS The following exit values shall be returned: 0: All input files were output successfully. >0 An error occurred. CONSEQUENCES OF ERRORS Default. The actual POSIX description continues with other sections, including APPLICATION USAGE , EXAMPLES and RATIONALE .
|
Team-FLY |