Intro(C) 06 January 1993 Intro(C) Name Intro - introduces UNIX commands Description This section describes the use of the individual commands available in the UNIX Operating System. Each individual command is labeled with either a C, or a CP for easy reference from other volumes. The letter ``C'' stands for ``command''. The letter ``P'' stands for commands that come with the optional Development System (Programming). For example, date(C) indicates a reference to a discussion of the date command in the C section; cc(CP) indicates a reference to a discussion of the cc command in the Development System. The Development System is an optional supple- mental package to the standard Operating System. The ``ADM'' Administration section contains miscellaneous information including considerable system maintenance information. Other reference sections include the ``M'' Miscellaneous section, the ``S'' System Ser- vices section, the ``HW'' Hardware section, and the ``F'' File Format section. Syntax Unless otherwise noted, commands described in the ``Syntax'' section of a manual page accept options and other arguments according to the following syntax and should be interpreted as explained below. name [-option...] [cmdarg...] where: [ ] Surround an option or cmdarg that is not mandatory. ... Indicates multiple occurrences of the option or cmdarg. name The name of an executable file. option This is always preceded by a ``-'' and may be in one of the two following forms: noargletter A single letter representing an option without an option-argument. Note that more than one noargletter option can be grouped after one ``-'' (Rule 5 in the following text). argletter A single letter representing an option requir- ing an option-argument. optarg An option-argument (character string) satisfying a preceding argletter. Note that groups of optargs following an argletter must be separated by commas or separated by white space and quoted (Rule 8 below). cmdarg Pathname (or other command argument) not beginning with ``-'', or ``-'' by itself indicating the standard input. Command syntax standard: rules These command syntax rules are not followed by all current commands, but all new commands use them. getopts(C) should be used by all shell pro- cedures to parse positional parameters and to check for legal options. It supports rules 3-10 below. The enforcement of the other rules must be done by the command itself. 1. Command names (name above) must be between two and nine characters long. 2. Command names must include only lowercase letters and digits. 3. Option names (option above) must be one character long. 4. All options must be preceded by ``-''. 5. Options with no arguments may be grouped after a single ``-''. 6. The first option-argument (optarg above) following an option must be preceded by white space. 7. Option-arguments cannot be optional. 8. Groups of option-arguments following an option must either be separated by commas or separated by white space and quoted (for example, -o xxx,z,yy or -o "xxx z yy"). 9. All options must precede operands (cmdarg above) on the command line. 10. ``--'' may be used to indicate the end of the options. 11. The order of the options relative to one another should not matter. 12. The relative order of the operands (cmdarg above) may affect their significance in ways determined by the command with which they appear. 13. ``-'' preceded and followed by white space should only be used to mean standard input. See also getopts(C), exit(S), getopt(S) and wait(S). Diagnostics Upon termination, each command returns 2 bytes of status, one supplied by the system and giving the cause for termination, and (in the case of ``normal'' termination) one supplied by the program (see wait(S) and exit(S)). The former byte is 0 for normal termination; the latter is customarily 0 for successful execution and non-zero to indicate troubles such as erroneous parameters, bad or inaccessible data. It is called variously ``exit code'', ``exit status'', or ``return code'', and is described only where special conventions are involved. Notes Not all commands adhere to the syntax described here.