diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/chio/chio.1 | 36 | ||||
-rw-r--r-- | bin/cp/cp.1 | 3 | ||||
-rw-r--r-- | bin/date/date.1 | 2 | ||||
-rw-r--r-- | bin/df/df.1 | 18 | ||||
-rw-r--r-- | bin/domainname/domainname.1 | 3 | ||||
-rw-r--r-- | bin/echo/echo.1 | 4 | ||||
-rw-r--r-- | bin/hostname/hostname.1 | 3 | ||||
-rw-r--r-- | bin/ln/ln.1 | 6 | ||||
-rw-r--r-- | bin/ln/symlink.7 | 15 | ||||
-rw-r--r-- | bin/ls/ls.1 | 2 | ||||
-rw-r--r-- | bin/pax/pax.1 | 4 | ||||
-rw-r--r-- | bin/rcp/rcp.1 | 3 | ||||
-rw-r--r-- | bin/rm/rm.1 | 6 | ||||
-rw-r--r-- | bin/setfacl/setfacl.1 | 24 | ||||
-rw-r--r-- | bin/sh/bltin/echo.1 | 6 | ||||
-rw-r--r-- | bin/sh/sh.1 | 282 | ||||
-rw-r--r-- | bin/stty/stty.1 | 35 | ||||
-rw-r--r-- | bin/test/test.1 | 6 |
18 files changed, 302 insertions, 156 deletions
diff --git a/bin/chio/chio.1 b/bin/chio/chio.1 index cb2e47a..280eed0 100644 --- a/bin/chio/chio.1 +++ b/bin/chio/chio.1 @@ -77,7 +77,8 @@ There are five element types: .Em drive (data transfer), and .Em voltag -(select by volume identifier). The +(select by volume identifier). +The .Em voltag pseudo-element type allows the selection of tapes by their volume tag (typically a barcode on the tape). @@ -114,7 +115,8 @@ is specified, the media unit will be inverted before insertion. .Op Cm inv1 .Op Cm inv2 .Xc -Perform a media unit exchange operation. The media unit in +Perform a media unit exchange operation. +The media unit in .Ar <src ET/EU> is moved to .Ar <dst1 ET/EU> @@ -177,10 +179,12 @@ Configure the changer to use picker .Xc Perform an .Em INITIALIZE ELEMENT STATUS -operation on the changer. The optional +operation on the changer. +The optional .Ar <timeout> parameter may be given to specify a timeout in seconds for the -operations. This may be used if the operation takes unusually long +operations. +This may be used if the operation takes unusually long because of buggy firmware or the like. .It Ic voltag Xo .Op Fl fca @@ -189,15 +193,18 @@ because of buggy firmware or the like. .Op Ar <label> .Op Ar <serial> .Xc -Change volume tag for an element in the media changer. This command -is only supported by few media changers. If it is not supported by a +Change volume tag for an element in the media changer. +This command +is only supported by few media changers. +If it is not supported by a device, using this command will usually result in an "Invalid Field in CDB" error message on the console. .Pp If the .Fl c flag is specified, the volume tag of the specified element is -cleared. If the +cleared. +If the .Fl f flag is specified, the volume tag is superseded with the specified volume tag even if a volume tag is already defined for the element. @@ -213,12 +220,14 @@ flag is given, with the alternate volume tag. .Op Fl vVsSbIa .Op Ar <type> .Xc -Report the status of all elements in the changer. If +Report the status of all elements in the changer. +If .Ar <type> is specified, report the status of all elements of type .Ar <type> . .It Fl v -Print the primary volume tag for each loaded medium, if any. The volume +Print the primary volume tag for each loaded medium, if any. +The volume tag is printed as .Dq <LABEL:SERIAL> . .It Fl V @@ -229,11 +238,14 @@ each element. .It Fl S Print the element source address for each element. .It Fl b -Print SCSI bus information for each element. Note that this information +Print SCSI bus information for each element. +Note that this information is valid only for drives. .It Fl I -Print the internal element addresses for each element. The internal -element address is not normally used with this driver. It is reported +Print the internal element addresses for each element. +The internal +element address is not normally used with this driver. +It is reported for diagnostic purposes only. .It Fl a Print all additional information (as in diff --git a/bin/cp/cp.1 b/bin/cp/cp.1 index 6c408b84..abec690 100644 --- a/bin/cp/cp.1 +++ b/bin/cp/cp.1 @@ -173,7 +173,8 @@ to be verbose, showing files as they are copied. .El .Pp For each destination file that already exists, its contents are -overwritten if permissions allow. Its mode, user ID, and group +overwritten if permissions allow. +Its mode, user ID, and group ID are unchanged unless the .Fl p option was specified. diff --git a/bin/date/date.1 b/bin/date/date.1 index 3d3af46..c882a10 100644 --- a/bin/date/date.1 +++ b/bin/date/date.1 @@ -247,7 +247,7 @@ Century prepended to the abbreviated year. .It Ar yy Year in abbreviated form -(e.g. 89 for 1989, 06 for 2006). +(e.g., 89 for 1989, 06 for 2006). .It Ar mm Numeric month, a number from 1 to 12. .It Ar dd diff --git a/bin/df/df.1 b/bin/df/df.1 index 3028393..76d3a02 100644 --- a/bin/df/df.1 +++ b/bin/df/df.1 @@ -62,36 +62,42 @@ The following options are available: Show all mount points, including those that were mounted with the MNT_IGNORE flag. .It Fl b -Use 512-byte blocks rather than the default. Note that +Use 512-byte blocks rather than the default. +Note that this overrides the .Ev BLOCKSIZE specification from the environment. .It Fl c Display a grand total. .It Fl g -Use 1073741824-byte (1-Gbyte) blocks rather than the default. Note that +Use 1073741824-byte (1-Gbyte) blocks rather than the default. +Note that this overrides the .Ev BLOCKSIZE specification from the environment. .It Fl H -"Human-readable" output. Use unit suffixes: Byte, Kilobyte, Megabyte, +"Human-readable" output. +Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to four or fewer using base 10 for sizes. .It Fl h -"Human-readable" output. Use unit suffixes: Byte, Kilobyte, Megabyte, +"Human-readable" output. +Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to four or fewer using base 2 for sizes. .It Fl i Include statistics on the number of free inodes. .It Fl k -Use 1024-byte (1-Kbyte) blocks rather than the default. Note that +Use 1024-byte (1-Kbyte) blocks rather than the default. +Note that this overrides the .Ev BLOCKSIZE specification from the environment. .It Fl l Only display information about locally-mounted file systems. .It Fl m -Use 1048576-byte (1-Mbyte) blocks rather than the default. Note that +Use 1048576-byte (1-Mbyte) blocks rather than the default. +Note that this overrides the .Ev BLOCKSIZE specification from the environment. diff --git a/bin/domainname/domainname.1 b/bin/domainname/domainname.1 index 1e408e3..f017fee 100644 --- a/bin/domainname/domainname.1 +++ b/bin/domainname/domainname.1 @@ -40,7 +40,8 @@ .Sh DESCRIPTION The .Nm -utility prints the name of the current YP/NIS domain. The super-user can +utility prints the name of the current YP/NIS domain. +The super-user can set the domain name by supplying an argument; this is usually done in the network initialization script .Pa /etc/rc.network , diff --git a/bin/echo/echo.1 b/bin/echo/echo.1 index e46eed0..6fdf213 100644 --- a/bin/echo/echo.1 +++ b/bin/echo/echo.1 @@ -63,7 +63,7 @@ Note that this option as well as the effect of .Ql \ec are implementation-defined in .St -p1003.1-2001 -as amended by Cor. 1-2002. +as amended by Cor.\& 1-2002. Applications aiming for maximum portability are strongly encouraged to use .Xr printf 1 @@ -88,4 +88,4 @@ The .Nm utility conforms to .St -p1003.1-2001 -as amended by Cor. 1-2002. +as amended by Cor.\& 1-2002. diff --git a/bin/hostname/hostname.1 b/bin/hostname/hostname.1 index c3d4bbb..060c509 100644 --- a/bin/hostname/hostname.1 +++ b/bin/hostname/hostname.1 @@ -41,7 +41,8 @@ .Sh DESCRIPTION The .Nm -utility prints the name of the current host. The super-user can +utility prints the name of the current host. +The super-user can set the hostname by supplying an argument; this is usually done in the network initialization script .Pa /etc/rc.network , diff --git a/bin/ln/ln.1 b/bin/ln/ln.1 index f438744..3f504ac 100644 --- a/bin/ln/ln.1 +++ b/bin/ln/ln.1 @@ -80,7 +80,8 @@ If the .Ar target_file or .Ar target_dir -is a symbolic link, do not follow it. This is most useful with the +is a symbolic link, do not follow it. +This is most useful with the .Fl f option, to replace a symlink which may point to a directory. .It Fl i @@ -123,7 +124,8 @@ the file. Hard links may not normally refer to directories and may not span file systems. .Pp A symbolic link contains the name of the file to -which it is linked. The referenced file is used when an +which it is linked. +The referenced file is used when an .Xr open 2 operation is performed on the link. A diff --git a/bin/ln/symlink.7 b/bin/ln/symlink.7 index eb2cffb..f637d33 100644 --- a/bin/ln/symlink.7 +++ b/bin/ln/symlink.7 @@ -45,7 +45,7 @@ file. Hard links may not refer to directories and may not reference files on different file systems. A symbolic link contains the name of the file to which it is linked, -i.e. it is a pointer to another name, and not to an underlying object. +i.e., it is a pointer to another name, and not to an underlying object. For this reason, symbolic links may reference directories and may span file systems. .Pp @@ -168,7 +168,7 @@ would display the contents of the file .Dq Li afile . .Pp It is important to realize that this rule includes commands which may -optionally traverse file trees, e.g. the command +optionally traverse file trees, e.g.\& the command .Dq Li "chown file" is included in this rule, while the command .Dq Li "chown -R file" @@ -209,7 +209,7 @@ The command is also an exception to this rule. For compatibility with historic systems (when .Nm ls -is not doing a tree walk, i.e. the +is not doing a tree walk, i.e., the .Fl R option is not specified), the @@ -224,7 +224,8 @@ or if the .Fl d or .Fl l -options are not specified. (The +options are not specified. +(The .Nm ls command is the only command where the .Fl H @@ -412,14 +413,16 @@ options. To maintain compatibility with historic systems, the .Nm ls -command acts a little differently. If you do not specify the +command acts a little differently. +If you do not specify the .Fl F , .Fl d or .Fl l options, .Nm ls -will follow symbolic links specified on the command line. If the +will follow symbolic links specified on the command line. +If the .Fl L flag is specified, .Nm ls diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index 5e6a29e..3fe48cd 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -609,7 +609,7 @@ directory writable to others, without sticky bit .Pp The default is .Qq "exfxcxdxbxegedabagacad" , -i.e. blue foreground and +i.e., blue foreground and default background for regular directories, black foreground and red background for setuid executables, etc. .It Ev LS_COLWIDTHS diff --git a/bin/pax/pax.1 b/bin/pax/pax.1 index 973fe43..76846f7 100644 --- a/bin/pax/pax.1 +++ b/bin/pax/pax.1 @@ -789,7 +789,7 @@ This option is the same as the option, except that the file inode change time is checked instead of the file modification time. The file inode change time can be used to select files whose inode information -(e.g. uid, gid, etc.) is newer than a copy of the file in the destination +(e.g.\& uid, gid, etc.) is newer than a copy of the file in the destination .Ar directory . .It Fl E Ar limit Limit the number of consecutive read faults while trying to read a flawed @@ -881,7 +881,7 @@ the file was last written). The .Ar c specifies the comparison of inode change time (the time when the file -inode was last changed; e.g. a change of owner, group, mode, etc). +inode was last changed; e.g.\& a change of owner, group, mode, etc). When .Ar c and diff --git a/bin/rcp/rcp.1 b/bin/rcp/rcp.1 index abfdbb0..aa47f97 100644 --- a/bin/rcp/rcp.1 +++ b/bin/rcp/rcp.1 @@ -47,7 +47,8 @@ .Sh DESCRIPTION The .Nm -utility copies files between machines. Each +utility copies files between machines. +Each .Ar file or .Ar directory diff --git a/bin/rm/rm.1 b/bin/rm/rm.1 index 8b2d32a..7a7437a5 100644 --- a/bin/rm/rm.1 +++ b/bin/rm/rm.1 @@ -144,13 +144,15 @@ to parse its arguments, which allows it to accept the .Sq Li -- option which will cause it to stop processing flag options at that -point. This will allow the removal of file names that begin +point. +This will allow the removal of file names that begin with a dash .Pq Sq - . For example: .Dl rm -- -filename The same behavior can be obtained by using an absolute or relative -path reference. For example: +path reference. +For example: .Dl rm /home/user/-filename .Dl rm ./-filename .Sh SEE ALSO diff --git a/bin/setfacl/setfacl.1 b/bin/setfacl/setfacl.1 index 452a041..d5787ea 100644 --- a/bin/setfacl/setfacl.1 +++ b/bin/setfacl/setfacl.1 @@ -61,15 +61,18 @@ and entries of the current ACL. .It Fl d The operations apply to the default ACL entries instead of -access ACL entries. Currently only directories may have +access ACL entries. +Currently only directories may have default ACL's. .It Fl h If the target of the operation is a symbolic link, perform the operation on the symbolic link itself, rather than following the link. .It Fl k -Delete any default ACL entries on the specified files. It +Delete any default ACL entries on the specified files. +It is not considered an error if the specified files do not have -any default ACL entries. An error will be reported if any of +any default ACL entries. +An error will be reported if any of the specified files cannot have a default entry (i.e.\& non-directories). .It Fl m Ar entries @@ -137,11 +140,14 @@ ACL entry for the file owner and the ACL entry. .It Ar "ACL qualifier" The ACL qualifier field describes the user or group associated with -the ACL entry. It may consist of one of the following: uid or -user name, gid or group name, or empty. For +the ACL entry. +It may consist of one of the following: uid or +user name, gid or group name, or empty. +For .Dq Li user ACL entries, an empty field specifies access granted to the -file owner. For +file owner. +For .Dq Li group ACL entries, an empty field specifies access granted to the file owning group. @@ -157,7 +163,8 @@ the following: and .Ql x to set read, write, and -execute permissions, respectively. Each of these may be excluded +execute permissions, respectively. +Each of these may be excluded or replaced with a .Ql - character to indicate no access. @@ -171,7 +178,8 @@ the default .Dq Li group , and .Dq Li other -ACL entries. If the +ACL entries. +If the .Fl n option is not specified and no .Dq Li mask diff --git a/bin/sh/bltin/echo.1 b/bin/sh/bltin/echo.1 index f1f021a..ae7a3b9 100644 --- a/bin/sh/bltin/echo.1 +++ b/bin/sh/bltin/echo.1 @@ -66,13 +66,15 @@ and may be given. .Pp If any of the following sequences of characters is encountered during -output, the sequence is not output. Instead, the specified action is +output, the sequence is not output. +Instead, the specified action is performed: .Bl -tag -width indent .It Li \eb A backspace character is output. .It Li \ec -Subsequent output is suppressed. This is normally used at the end of the +Subsequent output is suppressed. +This is normally used at the end of the last argument to suppress the trailing newline that .Nm would otherwise output. diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index 3aba4cb..65d4945 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -52,7 +52,8 @@ The current version of is in the process of being changed to conform with the .St -p1003.2 -specification for the shell. This version has many features which make +specification for the shell. +This version has many features which make it appear similar in some respects to the Korn shell, but it is not a Korn shell clone like pdksh. @@ -73,10 +74,12 @@ The shell implements a language that has flow control constructs, a macro facility that provides a variety of features in addition to data storage, along with built-in history and line -editing capabilities. It incorporates many features to +editing capabilities. +It incorporates many features to aid interactive use and has the advantage that the interpretative language is common to both interactive and non-interactive -use (shell scripts). That is, commands can be typed directly +use (shell scripts). +That is, commands can be typed directly to the running shell or can be put into a file, which can be executed directly by the shell. .Ss Invocation @@ -88,7 +91,8 @@ is connected to a terminal (or if the .Fl i option is set), -the shell is considered an interactive shell. An interactive shell +the shell is considered an interactive shell. +An interactive shell generally prompts before each command and handles programming and command errors differently (as described below). When first starting, the shell inspects argument 0, and @@ -96,12 +100,14 @@ if it begins with a dash .Pq Li - , the shell is also considered a login shell. This is normally done automatically by the system -when the user first logs in. A login shell first reads commands +when the user first logs in. +A login shell first reads commands from the files .Pa /etc/profile and then .Pa .profile -if they exist. If the environment variable +if they exist. +If the environment variable .Ev ENV is set on entry to a shell, or is set in the .Pa .profile @@ -128,14 +134,16 @@ The first non-option argument specified on the command line will be treated as the name of a file from which to read commands (a shell script), and the remaining arguments are set as the positional parameters -of the shell ($1, $2, etc). Otherwise, the shell reads commands +of the shell ($1, $2, etc). +Otherwise, the shell reads commands from its standard input. .Pp Unlike older versions of .Nm the .Ev ENV -script is only sourced on invocation of interactive shells. This +script is only sourced on invocation of interactive shells. +This closes a well-known, and sometimes easily exploitable security hole related to poorly thought out .Ev ENV @@ -218,7 +226,8 @@ Force the shell to behave interactively. Turn on job control (set automatically when interactive). .It Fl n Li noexec If not interactive, read commands but do not -execute them. This is useful for checking the +execute them. +This is useful for checking the syntax of shell scripts. .It Fl P Li physical Change the default for the @@ -232,9 +241,11 @@ to .Fl P (physical directory layout). .It Fl p Li privileged -Turn on privileged mode. This mode is enabled on startup +Turn on privileged mode. +This mode is enabled on startup if either the effective user or group id is not equal to the -real user or group id. Turning this mode off sets the +real user or group id. +Turning this mode off sets the effective user and group ids to the real user and group ids. When this mode is enabled for interactive shells, the file .Pa /etc/suid_profile @@ -247,9 +258,10 @@ is sourced, and the contents of the variable are ignored. .It Fl s Li stdin Read commands from standard input (set automatically -if no file arguments are present). This option has +if no file arguments are present). +This option has no effect when set after the shell has already started -running (i.e. when set with the +running (i.e., when set with the .Ic set command). .It Fl T Li trapsasync @@ -259,7 +271,8 @@ traps are executed after the child exits, as specified in .St -p1003.2 This nonstandard option is useful for putting guarding shells around -children that block signals. The surrounding shell may kill the child +children that block signals. +The surrounding shell may kill the child or it may just return control to the tty and leave the child alone, like this: .Bd -literal -offset indent @@ -278,7 +291,8 @@ command line editor (disables if it has been set). .It Fl v Li verbose The shell writes its input to standard error -as it is read. Useful for debugging. +as it is read. +Useful for debugging. .It Fl x Li xtrace Write each command (preceded by @@ -340,7 +354,8 @@ The following is a list of valid operators: .Ss Quoting Quoting is used to remove the special meaning of certain characters or words to the shell, such as operators, whitespace, or -keywords. There are three types of quoting: matched single quotes, +keywords. +There are three types of quoting: matched single quotes, matched double quotes, and backslash. .Bl -tag -width indent .It Single Quotes @@ -370,7 +385,8 @@ A backslash preceding a newline is treated as a line continuation. .Ss Reserved Words Reserved words are words that have special meaning to the shell and are recognized at the beginning of a line and -after a control operator. The following are reserved words: +after a control operator. +The following are reserved words: .Bl -column "doneXX" "elifXX" "elseXX" "untilXX" "whileX" -offset center .It Li \&! Ta { Ta } Ta Ic case Ta Ic do .It Ic done Ta Ic elif Ta Ic else Ta Ic esac Ta Ic fi @@ -379,7 +395,8 @@ after a control operator. The following are reserved words: .Ss Aliases An alias is a name and corresponding value set using the .Ic alias -built-in command. Whenever a reserved word may occur (see above), +built-in command. +Whenever a reserved word may occur (see above), and after checking for reserved words, the shell checks the word to see if it matches an alias. If it does, it replaces it in the input stream with its value. @@ -399,17 +416,21 @@ ls -F foobar .Pp Aliases provide a convenient way for naive users to create shorthands for commands without having to learn how -to create functions with arguments. They can also be -used to create lexically obscure code. This use is discouraged. +to create functions with arguments. +They can also be +used to create lexically obscure code. +This use is discouraged. .Ss Commands The shell interprets the words it reads according to a language, the specification of which is outside the scope of this man page (refer to the BNF in the .St -p1003.2 -document). Essentially though, a line is read and if +document). +Essentially though, a line is read and if the first word of the line (or after a control operator) is not a reserved word, then the shell has recognized a -simple command. Otherwise, a complex command or some +simple command. +Otherwise, a complex command or some other special construct may have been recognized. .Ss Simple Commands If a simple command has been recognized, the shell performs @@ -419,7 +440,8 @@ the following actions: Leading words of the form .Dq Li name=value are stripped off and assigned to the environment of -the simple command. Redirection operators and +the simple command. +Redirection operators and their arguments (as described below) are stripped off and saved for processing. .It @@ -427,7 +449,8 @@ The remaining words are expanded as described in the section called .Sx Word Expansions , and the first remaining word is considered the command -name and the command is located. The remaining +name and the command is located. +The remaining words are considered the arguments of the command. If no command name resulted, then the .Dq Li name=value @@ -439,8 +462,10 @@ the next section. .El .Ss Redirections Redirections are used to change where a command reads its input -or sends its output. In general, redirections open, close, or -duplicate an existing reference to a file. The overall format +or sends its output. +In general, redirections open, close, or +duplicate an existing reference to a file. +The overall format used for redirection is: .Pp .Dl [n] redir-op file @@ -448,7 +473,8 @@ used for redirection is: The .Ql redir-op is one of the redirection operators mentioned -previously. The following gives some examples of how these +previously. +The following gives some examples of how these operators can be used. Note that stdin and stdout are commonly used abbreviations for standard input and standard output respectively. @@ -486,7 +512,8 @@ delimiter .Pp All the text on successive lines up to the delimiter is saved away and made available to the command on standard -input, or file descriptor n if it is specified. If the delimiter +input, or file descriptor n if it is specified. +If the delimiter as specified on the initial line is quoted, then the here-doc-text is treated literally, otherwise the text is subjected to parameter expansion, command substitution, and arithmetic @@ -525,7 +552,7 @@ program in the file system (as described in the next section). When a normal program is executed, the shell runs the program, passing the arguments and the environment to the program. If the program is not a normal executable file -(i.e. if it does not begin with the +(i.e., if it does not begin with the .Qq magic number whose .Tn ASCII @@ -549,8 +576,10 @@ as a .Qq shell procedure . .Ss Path Search When locating a command, the shell first looks to see if -it has a shell function by that name. Then it looks for a -built-in command by that name. If a built-in command is not found, +it has a shell function by that name. +Then it looks for a +built-in command by that name. +If a built-in command is not found, one of two things happen: .Bl -enum .It @@ -559,10 +588,12 @@ performing any searches. .It The shell searches each entry in .Ev PATH -in turn for the command. The value of the +in turn for the command. +The value of the .Ev PATH variable should be a series of -entries separated by colons. Each entry consists of a +entries separated by colons. +Each entry consists of a directory name. The current directory may be indicated implicitly by an empty directory name, @@ -570,20 +601,24 @@ or explicitly by a single period. .El .Ss Command Exit Status Each command has an exit status that can influence the behavior -of other shell commands. The paradigm is that a command exits +of other shell commands. +The paradigm is that a command exits with zero for normal or success, and non-zero for failure, -error, or a false indication. The man page for each command +error, or a false indication. +The man page for each command should indicate the various exit codes and what they mean. Additionally, the built-in commands return exit codes, as does an executed shell function. .Pp If a command is terminated by a signal, its exit status is 128 plus -the signal number. Signal numbers are defined in the header file +the signal number. +Signal numbers are defined in the header file .In sys/signal.h . .Ss Complex Commands Complex commands are combinations of simple commands with control operators or reserved words, together creating a larger complex -command. More generally, a command is one of the following: +command. +More generally, a command is one of the following: .Bl -item -offset indent .It simple command @@ -601,9 +636,11 @@ Unless otherwise stated, the exit status of a command is that of the last simple command executed by the command. .Ss Pipelines A pipeline is a sequence of one or more commands separated -by the control operator |. The standard output of all but +by the control operator |. +The standard output of all but the last command is connected to the standard input -of the next command. The standard output of the last +of the next command. +The standard output of the last command is inherited from the shell, as usual. .Pp The format for a pipeline is: @@ -611,7 +648,8 @@ The format for a pipeline is: .Dl [!] command1 [ | command2 ...] .Pp The standard output of command1 is connected to the standard -input of command2. The standard input, standard output, or +input of command2. +The standard input, standard output, or both of a command is considered to be assigned by the pipeline before any redirection specified by redirection operators that are part of the command. @@ -619,17 +657,22 @@ operators that are part of the command. If the pipeline is not in the background (discussed later), the shell waits for all commands to complete. .Pp -If the reserved word ! does not precede the pipeline, the +If the reserved word +.Ic !\& +does not precede the pipeline, the exit status is the exit status of the last command specified -in the pipeline. Otherwise, the exit status is the logical -NOT of the exit status of the last command. That is, if +in the pipeline. +Otherwise, the exit status is the logical +NOT of the exit status of the last command. +That is, if the last command returns zero, the exit status is 1; if the last command returns greater than zero, the exit status is zero. .Pp Because pipeline assignment of standard input or standard output or both takes place before redirection, it can be -modified by redirection. For example: +modified by redirection. +For example: .Pp .Dl $ command1 2>&1 | command2 .Pp @@ -811,7 +854,8 @@ name ( ) command .Pp A function definition is an executable statement; when executed it installs a function named name and returns an -exit status of zero. The command is normally a list +exit status of zero. +The command is normally a list enclosed between .Dq Li { and @@ -836,7 +880,9 @@ command is implemented as a built-in command. When a variable is made local, it inherits the initial value and exported and readonly flags from the variable with the same name in the surrounding scope, if there is -one. Otherwise, the variable is initially unset. The shell +one. +Otherwise, the variable is initially unset. +The shell uses dynamic scoping, so that if the variable .Em x is made local to function @@ -877,10 +923,13 @@ The .Ic return command is implemented as a built-in command. .Ss Variables and Parameters -The shell maintains a set of parameters. A parameter -denoted by a name is called a variable. When starting up, +The shell maintains a set of parameters. +A parameter +denoted by a name is called a variable. +When starting up, the shell turns all the environment variables into shell -variables. New variables can be set using the form +variables. +New variables can be set using the form .Bd -literal -offset indent name=value .Ed @@ -893,16 +942,19 @@ or a special character as explained below. .Ss Positional Parameters A positional parameter is a parameter denoted by a number greater than zero. The shell sets these initially to the values of its command line -arguments that follow the name of the shell script. The +arguments that follow the name of the shell script. +The .Ic set built-in command can also be used to set or reset them. .Ss Special Parameters A special parameter is a parameter denoted by one of the following -special characters. The value of the parameter is listed +special characters. +The value of the parameter is listed next to its character. .Bl -hang .It Li * -Expands to the positional parameters, starting from one. When +Expands to the positional parameters, starting from one. +When the expansion occurs within a double-quoted string it expands to a single field with the value of each parameter separated by the first character of the @@ -914,7 +966,8 @@ if .Ev IFS is unset. .It Li @ -Expands to the positional parameters, starting from one. When +Expands to the positional parameters, starting from one. +When the expansion occurs within double-quotes, each positional parameter expands as a separate argument. If there are no positional parameters, the @@ -922,7 +975,8 @@ expansion of .Li @ generates zero arguments, even when .Li @ -is double-quoted. What this basically means, for example, is +is double-quoted. +What this basically means, for example, is if $1 is .Dq abc and $2 is @@ -944,11 +998,13 @@ option names concatenated into a string) as specified on invocation, by the set built-in command, or implicitly by the shell. .It Li $ -Expands to the process ID of the invoked shell. A subshell +Expands to the process ID of the invoked shell. +A subshell retains the same value of $ as its parent. .It Li \&! Expands to the process ID of the most recent background -command executed from the current shell. For a +command executed from the current shell. +For a pipeline, the process ID is that of the last command in the pipeline. .It Li 0 @@ -956,12 +1012,14 @@ pipeline. .El .Ss Word Expansions This clause describes the various expansions that are -performed on words. Not all expansions are performed on +performed on words. +Not all expansions are performed on every word, as explained later. .Pp Tilde expansions, parameter expansions, command substitutions, arithmetic expansions, and quote removals that occur within -a single word expand to a single field. It is only field +a single word expand to a single field. +It is only field splitting or pathname expansion that can create multiple fields from a single word. The single exception to this rule is @@ -1000,7 +1058,8 @@ subjected to tilde expansion. All the characters up to a slash .Pq Li / or the end of the word are treated as a username -and are replaced with the user's home directory. If the +and are replaced with the user's home directory. +If the username is missing (as in ~/foobar), the tilde is replaced with the value of the HOME variable (the current user's home directory). @@ -1045,30 +1104,37 @@ In addition, a parameter expansion can be modified by using one of the following formats. .Bl -tag -width indent .It Li ${parameter:-word} -Use Default Values. If parameter is unset or +Use Default Values. +If parameter is unset or null, the expansion of word is substituted; otherwise, the value of parameter is substituted. .It Li ${parameter:=word} -Assign Default Values. If parameter is unset +Assign Default Values. +If parameter is unset or null, the expansion of word is -assigned to parameter. In all cases, the +assigned to parameter. +In all cases, the final value of parameter is -substituted. Only variables, not positional +substituted. +Only variables, not positional parameters or special parameters, can be assigned in this way. .It Li ${parameter:?[word]} -Indicate Error if Null or Unset. If +Indicate Error if Null or Unset. +If parameter is unset or null, the expansion of word (or a message indicating it is unset if word is omitted) is written to standard error and the shell exits with a nonzero exit status. Otherwise, the value of -parameter is substituted. An +parameter is substituted. +An interactive shell need not exit. .It Li ${parameter:+word} -Use Alternate Value. If parameter is unset +Use Alternate Value. +If parameter is unset or null, null is substituted; otherwise, the expansion of word is substituted. @@ -1079,7 +1145,8 @@ format results in a test for a parameter that is unset or null; omission of the colon results in a test for a parameter that is only unset. .Bl -tag -width indent .It Li ${#parameter} -String Length. The length in characters of +String Length. +The length in characters of the value of parameter. .El .Pp @@ -1100,33 +1167,42 @@ cause the following four varieties of pattern characters to be quoted, whereas quoting characters within the braces has this effect. .Bl -tag -width indent .It Li ${parameter%word} -Remove Smallest Suffix Pattern. The word -is expanded to produce a pattern. The +Remove Smallest Suffix Pattern. +The word +is expanded to produce a pattern. +The parameter expansion then results in parameter, with the smallest portion of the suffix matched by the pattern deleted. .It Li ${parameter%%word} -Remove Largest Suffix Pattern. The word -is expanded to produce a pattern. The +Remove Largest Suffix Pattern. +The word +is expanded to produce a pattern. +The parameter expansion then results in parameter, with the largest portion of the suffix matched by the pattern deleted. .It Li ${parameter#word} -Remove Smallest Prefix Pattern. The word -is expanded to produce a pattern. The +Remove Smallest Prefix Pattern. +The word +is expanded to produce a pattern. +The parameter expansion then results in parameter, with the smallest portion of the prefix matched by the pattern deleted. .It Li ${parameter##word} -Remove Largest Prefix Pattern. The word -is expanded to produce a pattern. The +Remove Largest Prefix Pattern. +The word +is expanded to produce a pattern. +The parameter expansion then results in parameter, with the largest portion of the prefix matched by the pattern deleted. .El .Ss Command Substitution Command substitution allows the output of a command to be substituted in -place of the command name itself. Command substitution occurs when +place of the command name itself. +Command substitution occurs when the command is enclosed as follows: .Bd -literal -offset indent $(command) @@ -1155,7 +1231,8 @@ $((expression)) .Ed .Pp The expression is treated as if it were in double-quotes, except -that a double-quote inside the expression is not treated specially. The +that a double-quote inside the expression is not treated specially. +The shell expands all tokens in the expression for parameter expansion, command substitution, and quote removal. .Pp @@ -1177,8 +1254,10 @@ Unless the .Fl f option is set, file name generation is performed -after word splitting is complete. Each word is -viewed as a series of patterns, separated by slashes. The +after word splitting is complete. +Each word is +viewed as a series of patterns, separated by slashes. +The process of expansion replaces the word with the names of all existing files whose names can be formed by replacing each pattern with a string that matches the specified pattern. @@ -1241,7 +1320,8 @@ make it the first or last character listed. .Ss Built-in Commands This section lists the commands which are built-in because they need to perform some operation -that cannot be performed by a separate process. In addition to +that cannot be performed by a separate process. +In addition to these, a built-in version of the .Xr test 1 command is provided for efficiency. @@ -1259,9 +1339,11 @@ If .Ar file contains any .Dq / -characters, it is used as is. Otherwise, the shell searches the +characters, it is used as is. +Otherwise, the shell searches the .Ev PATH -for the file. If it is not found in the +for the file. +If it is not found in the .Ev PATH , it is sought in the current working directory. .It Ic alias Op Ar name ... @@ -1403,7 +1485,8 @@ Literal backslash If .Ar string is not enclosed in quotes then the backslash itself must be escaped -with a backslash to protect it from the shell. For example +with a backslash to protect it from the shell. +For example .Bd -literal -offset indent $ echo -e "a\evb" a @@ -1497,7 +1580,8 @@ is null or unset, is used as the editor. .It Fl l No (ell) List the commands rather than invoking -an editor on them. The commands are written in the +an editor on them. +The commands are written in the sequence indicated by the first and last operands, as affected by .Fl r , @@ -1575,7 +1659,8 @@ command deprecates the older command. The first argument should be a series of letters, each possibly followed by a colon which indicates that the option takes an argument. -The specified variable is set to the parsed option. The index of +The specified variable is set to the parsed option. +The index of the next argument is placed into the shell variable .Ev OPTIND . If an option takes an argument, it is placed into the shell variable @@ -1629,11 +1714,14 @@ If the .Fl s option is specified, only the PIDs of the jobs are printed, one per line. .It Ic pwd Op Fl L | P -Print the path of the current directory. The built-in command may +Print the path of the current directory. +The built-in command may differ from the program of the same name because the built-in command remembers what the current directory -is rather than recomputing it each time. This makes -it faster. However, if the current directory is +is rather than recomputing it each time. +This makes +it faster. +However, if the current directory is renamed, the built-in version of .Xr pwd 1 @@ -1653,8 +1741,10 @@ The is printed if the .Fl p option is specified -and the standard input is a terminal. Then a line is -read from the standard input. The trailing newline +and the standard input is a terminal. +Then a line is +read from the standard input. +The trailing newline is deleted from the line and the line is split as described in the section on .Sx White Space Splitting (Field Splitting) @@ -1671,9 +1761,11 @@ variables are assigned the null string. Backslashes are treated specially, unless the .Fl r option is -specified. If a backslash is followed by +specified. +If a backslash is followed by a newline, the backslash and the newline will be -deleted. If a backslash is followed by any other +deleted. +If a backslash is followed by any other character, the backslash will be deleted and the following character will be treated as though it were not in .Ev IFS , @@ -1833,7 +1925,8 @@ only the superuser can increase it. The .Fl S option -specifies the soft limits instead. When displaying limits, +specifies the soft limits instead. +When displaying limits, only one of .Fl S or @@ -1930,7 +2023,8 @@ The command .Dq Li set -V ) enables vi-mode editing and places .Nm -into vi insert mode. With vi-mode enabled, +into vi insert mode. +With vi-mode enabled, .Nm can be switched between insert mode and command mode by typing .Aq ESC . diff --git a/bin/stty/stty.1 b/bin/stty/stty.1 index 71908d2..9d3ccaf 100644 --- a/bin/stty/stty.1 +++ b/bin/stty/stty.1 @@ -69,7 +69,8 @@ in the traditional .It Fl f Open and use the terminal named by .Ar file -rather than using standard input. The file is opened +rather than using standard input. +The file is opened using the .Dv O_NONBLOCK flag of @@ -90,7 +91,8 @@ characteristics: .Ss Control Modes: .Pp Control mode flags affect hardware characteristics associated with the -terminal. This corresponds to the c_cflag in the termios structure. +terminal. +This corresponds to the c_cflag in the termios structure. .Bl -tag -width Fl .It Cm parenb Pq Fl parenb Enable (disable) parity generation @@ -210,11 +212,13 @@ to restart output. .It Cm imaxbel Pq Fl imaxbel The system imposes a limit of .Dv MAX_INPUT -(currently 255) characters in the input queue. If +(currently 255) characters in the input queue. +If .Cm imaxbel is set and the input queue limit has been reached, subsequent input causes the system to send an ASCII BEL -character to the output queue (the terminal beeps at you). Otherwise, +character to the output queue (the terminal beeps at you). +Otherwise, if .Cm imaxbel is unset and the input queue is full, the next input character causes @@ -316,19 +320,22 @@ is disabled. .It Cm echoctl Pq Fl echoctl If .Cm echoctl -is set, echo control characters as ^X. Otherwise control characters +is set, echo control characters as ^X. +Otherwise control characters echo as themselves. .It Cm echoprt Pq Fl echoprt For printing terminals. If set, echo erased characters backwards within ``\\'' -and ``/''. Otherwise, disable this feature. +and ``/''. +Otherwise, disable this feature. .It Cm noflsh Pq Fl noflsh Disable (enable) flush after .Dv INTR , QUIT , SUSP . .It Cm tostop Pq Fl tostop Send (do not send) .Dv SIGTTOU -for background output. This causes background jobs to stop if they attempt +for background output. +This causes background jobs to stop if they attempt terminal output. .It Cm altwerase Pq Fl altwerase Use (do not use) an alternate word erase algorithm when processing @@ -342,7 +349,8 @@ erased with simply an .Dv ERASE character.) .It Cm mdmbuf Pq Fl mdmbuf -If set, flow control output based on condition of Carrier Detect. Otherwise +If set, flow control output based on condition of Carrier Detect. +Otherwise writes return an error if Carrier Detect is low (and Carrier is not being ignored with the .Dv CLOCAL @@ -367,7 +375,7 @@ that character. If string is the two character sequence "^-" or the string "undef" the control character -is disabled (i.e. set to +is disabled (i.e., set to .Pf { Dv _POSIX_VDISABLE Ns } . ) .Pp Recognized control-characters: @@ -444,7 +452,8 @@ Set (disable) all modes suitable for a CRT display device. Enable (disable) the system generated status line associated with processing a .Dv STATUS -character (usually set to ^T). The status line consists of the +character (usually set to ^T). +The status line consists of the system load average, the current command name, its process ID, the event the process is waiting on (or the status of the process), the user and system times, percent cpu, and current memory usage. @@ -478,7 +487,8 @@ to a pty. If set, change the modes of the terminal so that no input or output processing is performed. If unset, change the modes of the terminal to some reasonable -state that performs input and output processing. Note that since the +state that performs input and output processing. +Note that since the terminal driver no longer has a single .Dv RAW bit, it is not possible to intuit what flags were set prior to setting @@ -581,7 +591,8 @@ The .Nm utility is expected to be .St -p1003.2 -compatible. The flags +compatible. +The flags .Fl e and .Fl f diff --git a/bin/test/test.1 b/bin/test/test.1 index 35e810c..bcb79f2 100644 --- a/bin/test/test.1 +++ b/bin/test/test.1 @@ -298,12 +298,14 @@ manual page. .Sh GRAMMAR AMBIGUITY The .Nm -grammar is inherently ambiguous. In order to assure a degree of consistency, +grammar is inherently ambiguous. +In order to assure a degree of consistency, the cases described in the .St -p1003.2 , section D11.2/4.62.4, standard are evaluated consistently according to the rules specified in the -standards document. All other cases are subject to the ambiguity in the +standards document. +All other cases are subject to the ambiguity in the command semantics. .Sh RETURN VALUES The |