From 14dfaa4b033ab5f50fa81fc0a4d1d6cfacb8abcb Mon Sep 17 00:00:00 2001 From: wiz Date: Wed, 25 Sep 2002 15:18:36 +0000 Subject: [PATCH] New policy: New sentences start on a new line. Patches by Robert Elz , with minimal changes by me. --- bin/cat/cat.1 | 5 +- bin/chio/chio.1 | 22 +- bin/csh/csh.1 | 198 +++++++----- bin/date/date.1 | 12 +- bin/df/df.1 | 11 +- bin/domainname/domainname.1 | 8 +- bin/ed/ed.1 | 191 ++++++----- bin/expr/expr.1 | 14 +- bin/hostname/hostname.1 | 8 +- bin/ln/ln.1 | 8 +- bin/ls/ls.1 | 19 +- bin/mkdir/mkdir.1 | 6 +- bin/mt/mt.1 | 13 +- bin/pax/pax.1 | 18 +- bin/ps/ps.1 | 15 +- bin/pwd/pwd.1 | 5 +- bin/rcmd/rcmd.1 | 9 +- bin/rcp/rcp.1 | 5 +- bin/sh/sh.1 | 614 +++++++++++++++++++++--------------- bin/sleep/sleep.1 | 12 +- bin/stty/stty.1 | 57 ++-- bin/systrace/systrace.1 | 22 +- bin/test/test.1 | 13 +- 23 files changed, 737 insertions(+), 548 deletions(-) diff --git a/bin/cat/cat.1 b/bin/cat/cat.1 index 1fdee1398397..4ae199a5aea6 100644 --- a/bin/cat/cat.1 +++ b/bin/cat/cat.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: cat.1,v 1.27 2002/07/03 01:27:23 enami Exp $ +.\" $NetBSD: cat.1,v 1.28 2002/09/25 15:18:36 wiz Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -85,7 +85,8 @@ This lock is set using .Xr fcntl 2 with the .Dv F_SETLKW -command. If the output file is already locked, +command. +If the output file is already locked, .Nm will block until the lock is acquired. .It Fl n diff --git a/bin/chio/chio.1 b/bin/chio/chio.1 index 743e28fa6462..2a528364472b 100644 --- a/bin/chio/chio.1 +++ b/bin/chio/chio.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: chio.1,v 1.13 2002/02/08 01:21:55 ross Exp $ +.\" $NetBSD: chio.1,v 1.14 2002/09/25 15:18:37 wiz Exp $ .\" .\" Copyright (c) 1996, 1998, 1999 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -79,11 +79,13 @@ There are four element types: .Pa portal (import/export), and .Pa drive -(data transfer). In this command description, the shorthand +(data transfer). +In this command description, the shorthand .Ic ET will be used to represent an element type, and .Ic EU -will be used to represent an element unit. For example, to represent +will be used to represent an element unit. +For example, to represent the first robotic arm in the changer, the ET would be .Dq picker and the EU would be @@ -109,7 +111,8 @@ is specified, the media unit will be inverted before insertion. .Op Ar inv1 .Op Ar inv2 .Pp -Performs a media unit exchange operation. The media unit in +Performs a media unit exchange operation. +The media unit in .Pa \*[Lt]src ET/EU\*[Gt] is moved to .Pa \*[Lt]dst1 ET/EU\*[Gt] @@ -173,7 +176,8 @@ Configure the changer to use picker .Oo Ar \*[Lt]type\*[Gt] Oo unit Oo count Oc Oc Oc .Op Ar voltags .Pp -Report the status of all elements in the changer. If +Report the status of all elements in the changer. +If .Pa \*[Lt]type\*[Gt] is specified, report the status of all elements of type .Pa \*[Lt]type\*[Gt] . @@ -217,8 +221,9 @@ operation on the changer. .Ar \*[Lt]slot\*[Gt] .Pp This command is provided for controlling CD-ROM changer mechanisms which -cannot use the standard changer control interface. ATAPI CD-ROM changers -fall into this category. There are 3 sub-commands: +cannot use the standard changer control interface. +ATAPI CD-ROM changers fall into this category. +There are 3 sub-commands: .Bl -tag -width indent .It Nm load Loads the media from the specified slot into the CD-ROM drive. @@ -252,6 +257,7 @@ Returns status of all elements in the second changer. The .Nm program and SCSI changer driver were originally written by Jason R. Thorpe -for And Communications, http://www.and.com/. Additional development was +for And Communications, http://www.and.com/. +Additional development was done by Jason R. Thorpe for the Numerical Aerospace Simulation Facility, NASA Ames Research Center. diff --git a/bin/csh/csh.1 b/bin/csh/csh.1 index 359c0a96904d..f46ac3439590 100644 --- a/bin/csh/csh.1 +++ b/bin/csh/csh.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: csh.1,v 1.34 2002/02/08 01:21:56 ross Exp $ +.\" $NetBSD: csh.1,v 1.35 2002/09/25 15:18:37 wiz Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -56,7 +56,8 @@ job control facilities (see interactive file name and user name completion (see .Sx File Name Completion ) , -and a C-like syntax. It is used both as an interactive +and a C-like syntax. +It is used both as an interactive login shell and a shell script command processor. .Ss Argument list processing If the first argument (argument 0) to the shell is @@ -100,7 +101,8 @@ is the only flag specified). .It Fl m Read .Pa \&.cshrc -even if not owned by the user. This flag is normally given only by +even if not owned by the user. +This flag is normally given only by .Xr su 1 . .It Fl n Commands are parsed, but not executed. @@ -199,7 +201,8 @@ following exceptions. The characters `\*[Am]' `\&|' `;' `\*[Lt]' `\*[Gt]' `(' `)' form separate words. -If doubled in `\*[Am]\*[Am]', `\&|\&|', `\*[Lt]\*[Lt]' or `\*[Gt]\*[Gt]' these pairs form single words. +If doubled in `\*[Am]\*[Am]', +`\&|\&|', `\*[Lt]\*[Lt]' or `\*[Gt]\*[Gt]' these pairs form single words. These parser metacharacters may be made part of other words, or prevented their special meaning, by preceding them with `\e'. A newline preceded by a `\e' is equivalent to a blank. @@ -231,20 +234,22 @@ waiting for it to terminate by following it with an `\*[Am]'. .Pp Any of the above may be placed in `(' `)' to form a simple command (that may be a component of a pipeline, etc.). -It is also possible to separate pipelines with `\&|\&|' or `\*[Am]\*[Am]' showing, -as in the C language, +It is also possible to separate pipelines with `\&|\&|' +or `\*[Am]\*[Am]' showing, as in the C language, that the second is to be executed only if the first fails or succeeds -respectively. (See -.Em Expressions . ) +respectively. +(See +.Sx Expressions . ) .Ss Jobs The shell associates a .Ar job -with each pipeline. It keeps +with each pipeline. +It keeps a table of current jobs, printed by the .Ar jobs -command, and assigns them small integer numbers. When -a job is started asynchronously with `\*[Am]', the shell prints a line that looks -like: +command, and assigns them small integer numbers. +When a job is started asynchronously with `\*[Am]', +the shell prints a line that looks like: .Bd -filled -offset indent .Op 1 1234 @@ -257,8 +262,8 @@ If you are running a job and wish to do something else you may hit the key .Ic ^Z (control-Z) which sends a STOP signal to the current job. The shell will then normally show that the job has been `Stopped', -and print another prompt. You can then manipulate the state of this job, -putting it in the +and print another prompt. +You can then manipulate the state of this job, putting it in the .Em background with the .Ar bg @@ -272,7 +277,8 @@ A .Ic ^Z takes effect immediately and is like an interrupt in that pending output and unread input are discarded -when it is typed. There is another special key +when it is typed. +There is another special key .Ic ^Y that does not generate a STOP signal until a program attempts to .Xr read 2 @@ -281,15 +287,17 @@ This request can usefully be typed ahead when you have prepared some commands for a job that you wish to stop after it has read them. .Pp A job being run in the background will stop if it tries to read -from the terminal. Background jobs are normally allowed to produce output, +from the terminal. +Background jobs are normally allowed to produce output, but this can be disabled by giving the command ``stty tostop''. If you set this tty option, then background jobs will stop when they try to produce output like they do when they try to read input. .Pp -There are several ways to refer to jobs in the shell. The character -`%' introduces a job name. If you wish to refer to job number 1, you can -name it as `%1'. Just naming a job brings it to the foreground; thus +There are several ways to refer to jobs in the shell. +The character `%' introduces a job name. +If you wish to refer to job number 1, you can name it as `%1'. +Just naming a job brings it to the foreground; thus `%1' is a synonym for `fg %1', bringing job number 1 back into the foreground. Similarly saying `%1 \*[Am]' resumes job number 1 in the background. Jobs can also be named by prefixes of the string typed in to start them, @@ -297,16 +305,18 @@ if these prefixes are unambiguous, thus `%ex' would normally restart a suspended .Xr ex 1 job, if there were only one suspended job whose name began with -the string `ex'. It is also possible to say `%?string' +the string `ex'. +It is also possible to say `%?string' which specifies a job whose text contains .Ar string , if there is only one such job. .Pp The shell maintains a notion of the current and previous jobs. In output about jobs, the current job is marked with a `+' -and the previous job with a `\-'. The abbreviation `%+' refers -to the current job and `%\-' refers to the previous job. For close -analogy with the syntax of the +and the previous job with a `\-'. +The abbreviation `%+' refers +to the current job and `%\-' refers to the previous job. +For close analogy with the syntax of the .Ar history mechanism (described below), `%%' is also a synonym for the current job. @@ -315,19 +325,22 @@ The job control mechanism requires that the .Xr stty 1 option .Ic new -be set. It is an artifact from a +be set. +It is an artifact from a .Em new implementation of the tty driver that allows generation of interrupt characters from -the keyboard to tell jobs to stop. See +the keyboard to tell jobs to stop. +See .Xr stty 1 for details on setting options in the new tty driver. .Ss Status reporting This shell learns immediately whenever a process changes state. It normally informs you whenever a job becomes blocked so that no further progress is possible, but only just before it prints -a prompt. This is done so that it does not otherwise disturb your work. +a prompt. +This is done so that it does not otherwise disturb your work. If, however, you set the shell variable .Ar notify , the shell will notify you immediately of changes of status in background @@ -335,15 +348,18 @@ jobs. There is also a shell command .Ar notify that marks a single process so that its status changes will be immediately -reported. By default +reported. +By default .Ar notify marks the current process; simply say `notify' after starting a background job to mark it. .Pp When you try to leave the shell while jobs are stopped, you will -be warned that `You have stopped jobs.' You may use the +be warned that `You have stopped jobs.' +You may use the .Ar jobs -command to see what they are. If you do this or immediately try to +command to see what they are. +If you do this or immediately try to exit again, the shell will not warn you a second time, and the suspended jobs will be terminated. .Ss File Name Completion @@ -391,7 +407,8 @@ incomplete, since there are two file names matching the prefix ``D''. If a partial file name is followed by the end-of-file character (usually control-D), then, instead of completing the name, .Nm -will list all file names matching the prefix. For example, +will list all file names matching the prefix. +For example, the input .Pp .Dl % vi D\*[Lt]control-D\*[Gt] @@ -404,8 +421,8 @@ while the input line remains unchanged. .Pp The same system of escape and end-of-file can also be used to expand partial user names, if the word to be completed -(or listed) begins with the character ``~''. For example, -typing +(or listed) begins with the character ``~''. +For example, typing .Pp .Dl cd ~ro\*[Lt]escape\*[Gt] .Pp @@ -418,11 +435,13 @@ can be inhibited by setting the variable .Ar nobeep . .Pp Normally, all files in the particular directory are candidates -for name completion. Files with certain suffixes can be excluded +for name completion. +Files with certain suffixes can be excluded from consideration by setting the variable .Ar fignore to the -list of suffixes to be ignored. Thus, if +list of suffixes to be ignored. +Thus, if .Ar fignore is set by the command @@ -439,9 +458,11 @@ would result in the completion to .Pp ignoring the files "xmpl.o" and "xmpl.out". However, if the only completion possible requires not ignoring these -suffixes, then they are not ignored. In addition, +suffixes, then they are not ignored. +In addition, .Ar fignore -does not affect the listing of file names by control-D. All files +does not affect the listing of file names by control-D. +All files are listed regardless of their suffixes. .Ss Substitutions We now describe the various transformations the shell performs on the @@ -497,8 +518,7 @@ as in `!d' for event 12 or `!wri' for event 9, or by a string contained in a word in the command as in `!?mic?' also referring to event 9. These forms, without further change, simply reintroduce the words of the specified events, each separated by a single blank. -As a special case, `!!' refers to the previous command; thus `!!' -alone is a +As a special case, `!!' refers to the previous command; thus `!!' alone is a .Ar redo . .Pp To select words from an event we can follow the event specification by @@ -565,7 +585,8 @@ Repeat the previous substitution. Apply the change once on each word, prefixing the above, e.g., `g\*[Am]'. .It a Apply the change as many times as possible on a single word, prefixing -the above. It can be used together with `g' to apply a substitution +the above. +It can be used together with `g' to apply a substitution globally. .It p Print the new command line but do not execute it. @@ -576,8 +597,8 @@ Like q, but break into words at blanks, tabs and newlines. .El .Pp Unless preceded by a `g' the change is applied only to the first -modifiable word. With substitutions, it is an error for no word to be -applicable. +modifiable word. +With substitutions, it is an error for no word to be applicable. .Pp The left hand side of substitutions are not regular expressions in the sense of the editors, but instead strings. @@ -612,8 +633,8 @@ from the command matching `?foo?'. .Pp A special abbreviation of a history reference occurs when the first non-blank character of an input line is a `\*(ua'. -This is equivalent to `!:s\*(ua' providing a convenient shorthand for substitutions -on the text of the previous line. +This is equivalent to `!:s\*(ua' providing a convenient +shorthand for substitutions on the text of the previous line. Thus `\*(ualb\*(ualib' fixes the spelling of `lib' in the previous command. @@ -740,7 +761,8 @@ Braces insulate .Ar name from following characters that would otherwise be part of it. Shell variables have names consisting of up to 20 letters and digits -starting with a letter. The underscore character is considered a letter. +starting with a letter. +The underscore character is considered a letter. If .Ar name is not a shell variable, but is set in the environment, then @@ -944,7 +966,8 @@ Note that the default standard input for a command run detached is modified to be the empty file .Pa /dev/null ; instead the standard input -remains as the original standard input of the shell. If this is a terminal +remains as the original standard input of the shell. +If this is a terminal and if the process attempts to read from the terminal, then the process will block and the user will be notified (see .Sx Jobs @@ -973,7 +996,8 @@ The following operators are available: .Ed .Pp Here the precedence increases to the right, -`==' `!=' `=~' and `!~', `\*[Le]' `\*[Ge]' `\*[Lt]' and `\*[Gt]', `\*[Lt]\*[Lt]' and `\*[Gt]\*[Gt]', `+' and `\-', +`==' `!=' `=~' and `!~', `\*[Le]' `\*[Ge]' `\*[Lt]' +and `\*[Gt]', `\*[Lt]\*[Lt]' and `\*[Gt]\*[Gt]', `+' and `\-', `*' `/' and `%' being, in groups, at the same level. The `==' `!=' `=~' and `!~' operators compare their arguments as strings; all others operate on numbers. @@ -981,8 +1005,8 @@ The operators `=~' and `!~' are like `!=' and `==' except that the right hand side is a .Ar pattern (containing, e.g., `*'s, `?'s and instances of `[...]') -against which the left hand operand is matched. This reduces the -need for use of the +against which the left hand operand is matched. +This reduces the need for use of the .Ar switch statement in shell scripts when all that is really needed is pattern matching. .Pp @@ -992,7 +1016,8 @@ The result of all expressions are strings, which represent decimal numbers. It is important to note that no two components of an expression can appear in the same word; except when adjacent to components of expressions that -are syntactically significant to the parser (`\*[Am]' `\&|' `\*[Lt]' `\*[Gt]' `(' `)'), +are syntactically significant to the parser +(`\*[Am]' `\&|' `\*[Lt]' `\*[Gt]' `(' `)'), they should be surrounded by spaces. .Pp Also available in expressions as primitive operands are command executions @@ -1078,7 +1103,8 @@ or Shows the amount of dynamic memory acquired, broken down into used and free memory. With an argument shows the number of free and used blocks in each size -category. The categories start at size 8 and double at each step. +category. +The categories start at size 8 and double at each step. This command's output may vary across system types, since systems other than the VAX may use a different memory allocator. .Pp @@ -1173,7 +1199,8 @@ The arguments are read as input to the shell and the resulting command(s) executed in the context of the current shell. This is usually used to execute commands generated as the result of command or variable substitution, since -parsing occurs before these substitutions. See +parsing occurs before these substitutions. +See .Xr tset 1 for an example of using .Ic eval . @@ -1375,8 +1402,9 @@ all limitations are given. If the .Fl h flag is given, the hard limits are used instead of the current -limits. The hard limits impose a ceiling on the values of -the current limits. Only the super-user may raise the hard limits, +limits. +The hard limits impose a ceiling on the values of the current limits. +Only the super-user may raise the hard limits, but a user may lower or raise the current limits within the legal range. .Pp Resources controllable currently include @@ -1398,7 +1426,8 @@ size of the automatically-extended stack region), and The .Ar maximum-use may be given as a (floating point or integer) -number followed by a scale factor. For all limits other than +number followed by a scale factor. +For all limits other than .Ar cputime the default scale is `k' or `kilobytes' (1024 bytes); a scale factor of `m' or `megabytes' may also be used. @@ -1470,7 +1499,8 @@ All processes detached with `\*[Am]' are effectively .It Ic notify % Ns Ar job ... Causes the shell to notify the user asynchronously when the status of the current or specified jobs change; normally notification is presented -before a prompt. This is automatic if the shell variable +before a prompt. +This is automatic if the shell variable .Ic notify is set. .Pp @@ -1527,17 +1557,19 @@ With a numeric argument, rotates the .Ar n Ns \'th argument of the directory -stack around to be the top element and changes to it. The members +stack around to be the top element and changes to it. +The members of the directory stack are numbered from the top starting at 0. .Pp .It Ic rehash Causes the internal hash table of the contents of the directories in the .Ic path -variable to be recomputed. This is needed if new commands are added -to directories in the +variable to be recomputed. +This is needed if new commands are added to directories in the .Ic path -while you are logged in. This should only be necessary if you add +while you are logged in. +This should only be necessary if you add commands to one of your own directories, or if a systems programmer changes the contents of a system directory. .Pp @@ -1600,7 +1632,8 @@ The last form sets the value of environment variable .Ar name to be .Ar value , -a single string. The second form sets +a single string. +The second form sets .Ar name to an empty string. The most commonly used environment variables @@ -1694,13 +1727,16 @@ If arguments are given the specified simple command is timed and a time summary as described under the .Ic time -variable is printed. If necessary, an extra shell is created to print the time +variable is printed. +If necessary, an extra shell is created to print the time statistic when the command completes. .Pp .It Ic umask .It Ic umask Ar value The file creation mask is displayed (first form) or set to the specified -value (second form). The mask is given in octal. Common values for +value (second form). +The mask is given in octal. +Common values for the mask are 002 giving all access to the group and read and execute access to others or 022 giving all access except write access for users in the group or others. @@ -1725,9 +1761,11 @@ If no .Ar resource is specified, then all .Ar resource -limitations are removed. If +limitations are removed. +If .Fl h -is given, the corresponding hard limits are removed. Only the +is given, the corresponding hard limits are removed. +Only the super-user may do this. .Pp .It Ic unset Ar pattern @@ -1739,7 +1777,8 @@ It is not an error for nothing to be .Pp .It Ic unsetenv Ar pattern Removes all variables whose name match the specified pattern from the -environment. See also the +environment. +See also the .Ic setenv command above and .Xr printenv 1 . @@ -1882,7 +1921,8 @@ since these substitutions are then done selectively. Enable file name completion. .It Ic histchars Can be given a string value to change the characters used in history -substitution. The first character of its value is used as the +substitution. +The first character of its value is used as the history substitution character, replacing the default character `!'. The second character of its value replaces the character `^' in quick substitutions. @@ -1965,7 +2005,8 @@ variable after reading .Ar \&.cshrc , and each time the .Ar path -variable is reset. If new commands are added to these directories +variable is reset. +If new commands are added to these directories while the shell is active, it may be necessary to do a .Ic rehash or the commands may not be found. @@ -2003,10 +2044,10 @@ Builtin commands that fail return exit status `1', all other builtin commands set status to `0'. .It Ic time Controls automatic timing of commands. -This setting allows two parameters. The first specifies the CPU time -threshold at which reporting should be done for a process, and the optional -second specifies the output format. The following format strings are -available: +This setting allows two parameters. +The first specifies the CPU time threshold at which reporting should be done +for a process, and the optional second specifies the output format. +The following format strings are available: .Pp .Bl -tag -width Ds -compact -offset indent .It Li \&%c @@ -2189,8 +2230,7 @@ substitutions on a single line to 20. .Nm appeared in .Bx 3 . -It -was a first implementation of a command language interpreter +It was a first implementation of a command language interpreter incorporating a history mechanism (see .Sx History Substitutions ) , job control facilities (see @@ -2217,16 +2257,17 @@ as the job may have changed directories internally. .Pp Shell builtin functions are not stoppable/restartable. Command sequences of the form `a ; b ; c' are also not handled gracefully -when stopping is attempted. If you suspend `b', the shell will -immediately execute `c'. This is especially noticeable if this -expansion results from an +when stopping is attempted. +If you suspend `b', the shell will immediately execute `c'. +This is especially noticeable if this expansion results from an .Ar alias . It suffices to place the sequence of commands in ()'s to force it to a subshell, i.e., `( a ; b ; c )'. .Pp Control over tty output after processes are started is primitive; perhaps this will inspire someone to work on a good virtual -terminal interface. In a virtual terminal interface much more +terminal interface. +In a virtual terminal interface much more interesting things could be done with output control. .Pp Alias substitution is most often used to clumsily simulate shell procedures; @@ -2236,7 +2277,8 @@ Commands within loops, prompted for by `?', are not placed on the .Ic history list. Control structure should be parsed instead of being recognized as built-in -commands. This would allow control commands to be placed anywhere, +commands. +This would allow control commands to be placed anywhere, to be combined with `\&|', and to be used with `\*[Am]' and `;' metasyntax. .Pp It should be possible to use the `:' modifiers on the output of command diff --git a/bin/date/date.1 b/bin/date/date.1 index 341c3237d110..22df8bdac940 100644 --- a/bin/date/date.1 +++ b/bin/date/date.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: date.1,v 1.30 2002/02/08 01:21:56 ross Exp $ +.\" $NetBSD: date.1,v 1.31 2002/09/25 15:18:38 wiz Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -98,8 +98,8 @@ The format string may contain any of the conversion specifications described in the .Xr strftime 3 manual page, as well as any arbitrary text. -A \*[Lt]newline\*[Gt] character is always output after the characters specified by -the format string. +A \*[Lt]newline\*[Gt] character is always output after the characters +specified by the format string. The format string for the default display is: .Bd -literal -offset indent %a %b %e %H:%M:%S %Z %Y @@ -113,7 +113,8 @@ The canonical representation for setting the date and time is: .It Ar cc The first two digits of the year (the century). .It Ar yy -The second two digits of the year. If +The second two digits of the year. +If .Ar yy is specified, but .Ar cc @@ -121,7 +122,8 @@ is not, a value for .Ar yy between 69 and 99 results in a .Ar cc -value of 19. Otherwise, a +value of 19. +Otherwise, a .Ar cc value of 20 is used. .It Ar mm diff --git a/bin/df/df.1 b/bin/df/df.1 index 123d9d745f39..1f66f60fea66 100644 --- a/bin/df/df.1 +++ b/bin/df/df.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: df.1,v 1.25 2002/02/08 01:21:56 ross Exp $ +.\" $NetBSD: df.1,v 1.26 2002/09/25 15:18:38 wiz Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -71,7 +71,8 @@ on the filesystem is less than The following options are available: .Bl -tag -width Ds .It Fl a -Show all filesystems. By default only filesystems mounted with the +Show all filesystems. +By default only filesystems mounted with the .Dv MNT_IGNORE flag clear are shown. .It Fl i @@ -84,7 +85,8 @@ option causes the numbers to be reported in kilobyte (1024 bytes) counts. .It Fl l Display statistics only about mounted file systems with the .Dv MNT_LOCAL -flag set. If a non-local file system is given as an argument, a +flag set. +If a non-local file system is given as an argument, a warning is issued and no information is given on that file system. .It Fl m The @@ -136,7 +138,8 @@ The list of filesystem types can be prefixed with .Dq no to specify the filesystem types for which action should .Em not -be taken. If a file system is given on the command line that is not of +be taken. +If a file system is given on the command line that is not of the specified type, a warning is issued and no information is given on that file system. .El diff --git a/bin/domainname/domainname.1 b/bin/domainname/domainname.1 index 9939462c0979..c3b6f812ccdb 100644 --- a/bin/domainname/domainname.1 +++ b/bin/domainname/domainname.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: domainname.1,v 1.12 2001/02/27 17:48:19 mason Exp $ +.\" $NetBSD: domainname.1,v 1.13 2002/09/25 15:18:38 wiz Exp $ .\" .\" Copyright (c) 1983, 1988, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -46,9 +46,9 @@ .Nm prints the .Tn YP -domain name of the current host. The super-user can -set the domain name by supplying an argument; this is usually done in the -network initialization script +domain name of the current host. +The super-user can set the domain name by supplying an argument; +this is usually done in the network initialization script .Pa /etc/rc.d/network , normally run at boot time. diff --git a/bin/ed/ed.1 b/bin/ed/ed.1 index 6102f2b69db9..d0e38c8b620e 100644 --- a/bin/ed/ed.1 +++ b/bin/ed/ed.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: ed.1,v 1.21 2002/02/08 01:21:57 ross Exp $ +.\" $NetBSD: ed.1,v 1.22 2002/09/25 15:18:39 wiz Exp $ .\" .TH ED 1 "21 May 1993" .SH NAME @@ -61,16 +61,14 @@ When an input command, such as .I `c' (change), is given, .B ed -enters input mode. This is the primary means -of adding text to a file. +enters input mode. +This is the primary means of adding text to a file. In this mode, no commands are available; -instead, the standard input is written -directly to the editor buffer. Lines consist of text up to and -including a +instead, the standard input is written directly to the editor buffer. +Lines consist of text up to and including a .IR newline character. -Input mode is terminated by -entering a single period (\fI.\fR) on a line. +Input mode is terminated by entering a single period (\fI.\fR) on a line. All .B ed @@ -81,7 +79,8 @@ command deletes lines; the .I `m' command moves lines, and so on. It is possible to modify only a portion of a line by means of replacement, -as in the example above. However even here, the +as in the example above. +However even here, the .I `s' command is applied to whole lines at a time. @@ -96,13 +95,15 @@ commands have the structure: .RE .sp The address(es) indicate the line or range of lines to be affected by the -command. If fewer addresses are given than the command accepts, then +command. +If fewer addresses are given than the command accepts, then default addresses are supplied. .SS OPTIONS .TP 8 -s -Suppresses diagnostics. This should be used if +Suppresses diagnostics. +This should be used if .BR ed 's standard input is from a script. @@ -115,7 +116,8 @@ command). .TP 8 .RI \-p \ string -Specifies a command prompt. This may be toggled on and off with the +Specifies a command prompt. +This may be toggled on and off with the .I `P' command. @@ -126,10 +128,12 @@ regular expressions that are normally used. .TP 8 .I file -Specifies the name of a file to read. If +Specifies the name of a file to read. +If .I file is prefixed with a -bang (!), then it is interpreted as a shell command. In this case, +bang (!), then it is interpreted as a shell command. +In this case, what is read is the standard output of .I file @@ -149,13 +153,12 @@ maintains a which is typically supplied to commands as the default address when none is specified. When a file is first read, the current address is set to the last line -of the file. In general, the current address is set to the last line -affected by a command. +of the file. +In general, the current address is set to the last line affected by a command. -A line address is -constructed from one of the bases in the list below, optionally followed -by a numeric offset. The offset may include any combination -of digits, operators (i.e., +A line address is constructed from one of the bases in the list below, +optionally followed by a numeric offset. +The offset may include any combination of digits, operators (i.e., .IR + , .I - and @@ -172,9 +175,12 @@ This means "before the first line," and is legal wherever it makes sense. An address range is two addresses separated either by a comma or -semi-colon. The value of the first address in a range cannot exceed the -value of the second. If only one address is given in a range, then -the second address is set to the given address. If an +semi-colon. +The value of the first address in a range cannot exceed the +value of the second. +If only one address is given in a range, then +the second address is set to the given address. +If an .IR n- tuple of addresses is given where .I n \*[Gt] 2, @@ -184,9 +190,9 @@ the If only one address is expected, then the last address is used. Each address in a comma-delimited range is interpreted relative to the -current address. In a semi-colon-delimited range, the first address is -used to set the current address, and the second address is interpreted -relative to the first. +current address. +In a semi-colon-delimited range, the first address is used to set the +current address, and the second address is interpreted relative to the first. The following address symbols are recognized. @@ -247,15 +253,15 @@ is interpreted as .TP 8 , \fRor\fB % -The first through last lines in the buffer. This is equivalent to -the address range +The first through last lines in the buffer. +This is equivalent to the address range .I 1,$. .TP 8 ; The -current through last lines in the buffer. This is equivalent to -the address range +current through last lines in the buffer. +This is equivalent to the address range .I .,$. .TP 8 @@ -303,8 +309,8 @@ used by the command for selecting old text to be replaced with new. In addition to a specifying string literals, regular expressions can -represent -classes of strings. Strings thus represented are said to be matched +represent classes of strings. +Strings thus represented are said to be matched by the corresponding regular expression. If it is possible for a regular expression to match several strings in a line, then the left-most longest match is @@ -323,8 +329,7 @@ matches itself. \fR\e\fIc\fR Any backslash-escaped character .IR c , -except for `{', '}', `(', `)', `\*[Lt]' and `\*[Gt]', -matches itself. +except for `{', '}', `(', `)', `\*[Lt]' and `\*[Gt]', matches itself. .TP 8 \fR.\fR @@ -350,8 +355,7 @@ to specify sets of characters: .PD 0 \ \ [:blank:]\ \ [:graph:]\ \ [:punct:]\ \ [:xdigit:] .sp -If `-' appears as the first or last -character of +If `-' appears as the first or last character of .IR char-class , then it matches itself. All other characters in @@ -382,8 +386,7 @@ for an explanation of these constructs. Matches any single character, other than newline, not in .IR char-class . .IR char-class -is defined -as above. +is defined as above. .TP 8 ^ @@ -421,15 +424,15 @@ is a number in the range [1,9], expands to the text matched by the subexpression. For example, the regular expression `\e(.*\e)\e1' matches any string consisting of identical adjacent substrings. -Subexpressions are ordered relative to -their left delimiter. +Subexpressions are ordered relative to their left delimiter. .TP 8 * Matches the single character regular expression or subexpression -immediately preceding it zero or more times. If '*' is the first -character of a regular expression or subexpression, then it matches -itself. The `*' operator sometimes yields unexpected results. +immediately preceding it zero or more times. +If '*' is the first +character of a regular expression or subexpression, then it matches itself. +The `*' operator sometimes yields unexpected results. For example, the regular expression `b*' matches the beginning of the string `abbb' (as opposed to the substring `bbb'), since a null match is the only left-most match. @@ -462,8 +465,7 @@ All .B ed commands are single characters, though some require additonal parameters. If a command's parameters extend over several lines, then -each line except for the last -must be terminated with a backslash (\\). +each line except for the last must be terminated with a backslash (\\). In general, at most one command is allowed per line. However, most commands accept a print suffix, which is any of @@ -480,7 +482,8 @@ An interrupt (typically ^C) has the effect of aborting the current command and returning the editor to command mode. .B ed -recognizes the following commands. The commands are shown together with +recognizes the following commands. +The commands are shown together with the default address or address range supplied if none is specified (in parenthesis). @@ -492,7 +495,8 @@ The current address is set to last line entered. .TP 8 (.,.)c -Changes lines in the buffer. The addressed lines are deleted +Changes lines in the buffer. +The addressed lines are deleted from the buffer, and text is appended in their place. Text is entered in input mode. The current address is set to last line entered. @@ -501,7 +505,8 @@ The current address is set to last line entered. (.,.)d Deletes the addressed lines from the buffer. If there is a line after the deleted range, then the current address is set -to this line. Otherwise the current address is set to the line +to this line. +Otherwise the current address is set to the line before the deleted range. .TP 8 @@ -512,8 +517,7 @@ and sets the default filename. If .I file is not specified, then the default filename is used. -Any lines in the buffer are deleted before -the new file is read. +Any lines in the buffer are deleted before the new file is read. The current address is set to the last line read. .TP 8 @@ -536,8 +540,7 @@ Edits unconditionally. This is similar to the .I e -command, -except that unwritten changes are discarded without warning. +command, except that unwritten changes are discarded without warning. The current address is set to the last line read. .TP 8 @@ -554,8 +557,7 @@ Applies .I command-list to each of the addressed lines matching a regular expression .IR re . -The current address is set to the -line currently matched before +The current address is set to the line currently matched before .I command-list is executed. At the end of the @@ -585,8 +587,7 @@ command. Interactively edits the addressed lines matching a regular expression .IR re. For each matching line, -the line is printed, -the current address is set, +the line is printed, the current address is set, and the user is prompted to enter a .IR command-list . At the end of the @@ -599,7 +600,8 @@ The format of .I command-list is the same as that of the .I `g' -command. A newline alone acts as a null command list. +command. +A newline alone acts as a null command list. A single `\*[Am]' repeats the last non-null command list. .TP 8 @@ -621,8 +623,8 @@ The current address is set to the last line entered. .TP 8 (.,.+1)j -Joins the addressed lines. The addressed lines are -deleted from the buffer and replaced by a single +Joins the addressed lines. +The addressed lines are deleted from the buffer and replaced by a single line containing their joined text. The current address is set to the resultant line. @@ -634,8 +636,8 @@ The line can then be addressed as .I 'lc (i.e., a single quote followed by .I lc -) in subsequent commands. The mark is not cleared until the line is -deleted or otherwise modified. +) in subsequent commands. +The mark is not cleared until the line is deleted or otherwise modified. .TP 8 (.,.)l @@ -644,30 +646,28 @@ If a single line fills for than one screen (as might be the case when viewing a binary file, for instance), a `--More--' prompt is printed on the last line. .B ed -waits until the RETURN key is pressed -before displaying the next screen. -The current address is set to the last line -printed. +waits until the RETURN key is pressed before displaying the next screen. +The current address is set to the last line printed. .TP 8 (.,.)m(.) -Moves lines in the buffer. The addressed lines are moved to after the +Moves lines in the buffer. +The addressed lines are moved to after the right-hand destination address, which may be the address .IR 0 (zero). -The current address is set to the -last line moved. +The current address is set to the last line moved. .TP 8 (.,.)n Prints the addressed lines along with -their line numbers. The current address is set to the last line -printed. +their line numbers. +The current address is set to the last line printed. .TP 8 (.,.)p -Prints the addressed lines. The current address is set to the last line -printed. +Prints the addressed lines. +The current address is set to the last line printed. .TP 8 P @@ -684,17 +684,18 @@ Q Quits ed unconditionally. This is similar to the .I q -command, -except that unwritten changes are discarded without warning. +command, except that unwritten changes are discarded without warning. .TP 8 .RI ($)r \ file Reads .I file -to after the addressed line. If +to after the addressed line. +If .I file is not specified, then the default -filename is used. If there was no default filename prior to the command, +filename is used. +If there was no default filename prior to the command, then the default filename is set to .IR file . Otherwise, the default filename is unchanged. @@ -702,9 +703,7 @@ The current address is set to the last line read. .TP 8 .RI ($)r \ !command -Reads -to after the addressed line -the standard output of +Reads to after the addressed line the standard output of .IR `!command' , (see the .RI ! command @@ -720,8 +719,7 @@ The current address is set to the last line read. .HP .RI (.,.)s /re/replacement/n .br -Replaces text in the addressed lines -matching a regular expression +Replaces text in the addressed lines matching a regular expression .I re with .IR replacement . @@ -808,8 +806,7 @@ Copies (i.e., transfers) the addressed lines to after the right-hand destination address, which may be the address .IR 0 (zero). -The current address is set to the last line -copied. +The current address is set to the last line copied. .TP 8 u @@ -852,8 +849,8 @@ Any previous contents of is lost without warning. If there is no default filename, then the default filename is set to .IR file, -otherwise it is unchanged. If no filename is specified, then the default -filename is used. +otherwise it is unchanged. +If no filename is specified, then the default filename is used. The current address is unchanged. .TP 8 @@ -884,9 +881,9 @@ The current address is unchanged. .TP 8 x -Prompts for an encryption key which is used in subsequent reads and -writes. If a newline alone is entered as the key, then encryption is -turned off. Otherwise, echoing is disabled while a key is read. +Prompts for an encryption key which is used in subsequent reads and writes. +If a newline alone is entered as the key, then encryption is turned off. +Otherwise, echoing is disabled while a key is read. Encryption/decryption is done using the .IR bdes (1) algorithm. @@ -895,7 +892,8 @@ algorithm. .RI (.+1)z n Scrolls .I n -lines at a time starting at addressed line. If +lines at a time starting at addressed line. +If .I n is not specified, then the current window size is used. The current address is set to the last line printed. @@ -928,8 +926,7 @@ Prints the line number of the addressed line. .TP 8 (.+1)newline -Prints the addressed line, and sets the current address to -that line. +Prints the addressed line, and sets the current address to that line. .SH ENVIRONMENTAL VARIABLES .TP @@ -966,13 +963,13 @@ Addison-Wesley, 1981. processes .I file arguments for backslash escapes, i.e., in a filename, -any characters preceded by a backslash (\\) are -interpreted literally. +any characters preceded by a backslash (\\) are interpreted literally. If a text (non-binary) file is not terminated by a newline character, then .B ed -appends one on reading/writing it. In the case of a binary file, +appends one on reading/writing it. +In the case of a binary file, .B ed does not append a newline on reading/writing. @@ -983,8 +980,7 @@ When an error occurs, .B ed prints a `?' and either returns to command mode or exits if its input is from a script. -An explanation of the last error can be -printed with the +An explanation of the last error can be printed with the .I `h' (help) command. @@ -1008,7 +1004,6 @@ the command list is executed only once. If diagnostics are not disabled, attempting to quit .B ed -or edit another file before writing a modified buffer -results in an error. +or edit another file before writing a modified buffer results in an error. If the command is entered a second time, it succeeds, but any changes to the buffer are lost. diff --git a/bin/expr/expr.1 b/bin/expr/expr.1 index e947f1f36c11..15736401fefa 100644 --- a/bin/expr/expr.1 +++ b/bin/expr/expr.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: expr.1,v 1.20 2002/02/19 21:14:45 pooka Exp $ +.\" $NetBSD: expr.1,v 1.21 2002/09/25 15:18:39 wiz Exp $ .\" .\" Written by J.T. Conklin . .\" Public domain. @@ -55,7 +55,8 @@ operator matches .Ar expr1 against .Ar expr2 , -which must be a regular expression. The regular expression is anchored +which must be a regular expression. +The regular expression is anchored to the beginning of the string with an implicit .Dq ^ . .Pp @@ -142,7 +143,8 @@ by This implementation of .Nm internally uses 64 bit represenation of integers and checks for -over- and underflows. It also treats / (division mark) and +over- and underflows. +It also treats / (division mark) and option '--' correctly depending upon context. .Pp .Nm @@ -150,7 +152,8 @@ on other systems (including .Nx up to and including .Nx 1.5 ) -might be not so graceful. Arithmetic results might be arbitrarily +might be not so graceful. +Arithmetic results might be arbitrarily limited on such systems, most commonly to 32 bit quantities. This means such .Nm @@ -179,7 +182,8 @@ Some .Nm implementations don't recognize it at all, others might ignore it even in cases where doing so results in syntax -error. There should be same result for both following examples, +error. +There should be same result for both following examples, but it might not always be: .Bl -enum -compact -offset indent .It diff --git a/bin/hostname/hostname.1 b/bin/hostname/hostname.1 index bcc8afa52eb2..a785067f4766 100644 --- a/bin/hostname/hostname.1 +++ b/bin/hostname/hostname.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: hostname.1,v 1.15 2001/02/27 17:47:22 mason Exp $ +.\" $NetBSD: hostname.1,v 1.16 2002/09/25 15:18:39 wiz Exp $ .\" .\" Copyright (c) 1983, 1988, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -45,9 +45,9 @@ .Op Ar name-of-host .Sh DESCRIPTION .Nm -prints the name of the current host. The super-user can -set the host name by supplying an argument; this is usually done in the -network initialization script +prints the name of the current host. +The super-user can set the host name by supplying an argument; this is +usually done in the network initialization script .Pa /etc/rc.d/network , normally run at boot time. diff --git a/bin/ln/ln.1 b/bin/ln/ln.1 index 248ede186e3b..d890124a3dbe 100644 --- a/bin/ln/ln.1 +++ b/bin/ln/ln.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: ln.1,v 1.15 2000/10/14 18:31:57 bjh21 Exp $ +.\" $NetBSD: ln.1,v 1.16 2002/09/25 15:18:39 wiz Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -75,7 +75,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 n @@ -99,7 +100,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/ls/ls.1 b/bin/ls/ls.1 index 2097720bf068..1f6167304a34 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: ls.1,v 1.34 2002/06/24 20:14:35 kleink Exp $ +.\" $NetBSD: ls.1,v 1.35 2002/09/25 15:18:40 wiz Exp $ .\" .\" Copyright (c) 1980, 1990, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -122,7 +122,9 @@ Modifies the .Fl s option, causing the sizes to be reported in kilobytes. .It Fl l -(The lowercase letter ``ell.'') List in long format. (See below.) +(The lowercase letter ``ell.'') +List in long format. +(See below.) If the output is to a terminal, a total sum for all the file sizes is output on a line before the long listing. .It Fl m @@ -169,10 +171,9 @@ or printing .It Fl x Multi-column output sorted across the page rather than down the page. .It Fl \&1 -(The numeric digit ``one.'') Force output to be -one entry per line. -This is the default when -output is not to a terminal. +(The numeric digit ``one.'') +Force output to be one entry per line. +This is the default when output is not to a terminal. .El .Pp The @@ -319,7 +320,8 @@ The file is executable or the directory is searchable. .It Sy \- The file is neither readable, writable, executable, -nor set-user-ID nor set-group-ID mode, nor sticky. (See below.) +nor set-user-ID nor set-group-ID mode, nor sticky. +(See below.) .El .Pp These next two apply only to the third character in the last group @@ -329,7 +331,8 @@ These next two apply only to the third character in the last group The sticky bit is set (mode .Li 1000 ) , -but not execute or search permission. (See +but not execute or search permission. +(See .Xr chmod 1 or .Xr sticky 8 . ) diff --git a/bin/mkdir/mkdir.1 b/bin/mkdir/mkdir.1 index 7e89970f3cf8..3f3ae74742fe 100644 --- a/bin/mkdir/mkdir.1 +++ b/bin/mkdir/mkdir.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: mkdir.1,v 1.14 2002/02/08 01:21:58 ross Exp $ +.\" $NetBSD: mkdir.1,v 1.15 2002/09/25 15:18:40 wiz Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -77,8 +77,8 @@ operand must already exist. Intermediate directories are created with permission bits of .Li rwxrwxrwx (\&0777) as modified by the current umask, plus write and search -permission for the owner. Do not consider it an error if the -argument directory already exists. +permission for the owner. +Do not consider it an error if the argument directory already exists. .El .Pp The user must have write permission in the parent directory. diff --git a/bin/mt/mt.1 b/bin/mt/mt.1 index e49f65773498..62c04a4e13f4 100644 --- a/bin/mt/mt.1 +++ b/bin/mt/mt.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: mt.1,v 1.29 2002/08/13 13:22:35 wiz Exp $ +.\" $NetBSD: mt.1,v 1.30 2002/09/25 15:18:41 wiz Exp $ .\" .\" Copyright (c) 1981, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -85,8 +85,8 @@ need be specified. .It Cm asf Move forward .Ar count -files from the beginning of the tape. This is accomplished by a rewind -followed by fsf +files from the beginning of the tape. +This is accomplished by a rewind followed by fsf .Ar count . .It Cm eof , weof Write @@ -142,7 +142,8 @@ Set the tape density code to .Ar count as specified in the .Tn SCSI-3 -specification. See the +specification. +See the .Sx DENSITY CODES section for a list of codes for commonly used media types. .It Cm rdspos @@ -178,8 +179,8 @@ returns a 0 exit status when the operation(s) were successful, 1 if the command was unrecognized, and 2 if an operation failed. .Sh DENSITY CODES The SCSI-3 specification defines a number of density codes for -various tape media, some of which are listed here. Note that -many tape drive vendors also define model-specific codes. +various tape media, some of which are listed here. +Note that many tape drive vendors also define model-specific codes. .Pp .Bl -column "Code" "Format" -compact .It Em "Code Format" diff --git a/bin/pax/pax.1 b/bin/pax/pax.1 index 90eaa1125ca2..f754d5f9cb3a 100644 --- a/bin/pax/pax.1 +++ b/bin/pax/pax.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: pax.1,v 1.33 2002/04/21 00:10:09 wiz Exp $ +.\" $NetBSD: pax.1,v 1.34 2002/09/25 15:18:41 wiz Exp $ .\" .\" Copyright (c) 1992 Keith Muller. .\" Copyright (c) 1992, 1993 @@ -506,7 +506,8 @@ cannot be opened for reading and writing. .It Fl k Do not overwrite existing files. .It Fl l -Link files. (The letter ell). +Link files. +(The letter ell). In the .Em copy mode @@ -653,7 +654,8 @@ The optional trailing .Cm g continues to apply the substitution expression to the pathname substring which starts with the first character following the end of the last successful -substitution. The first unsuccessful substitution stops the operation of the +substitution. +The first unsuccessful substitution stops the operation of the .Cm g option. The optional trailing @@ -941,9 +943,11 @@ and .Xr getgrnam 3 (and related) library calls. .It Fl O -Force the archive to be one volume. If a volume ends prematurely, +Force the archive to be one volume. +If a volume ends prematurely, .Nm -will not prompt for a new volume. This option can be useful for +will not prompt for a new volume. +This option can be useful for automated tasks where error recovery cannot be performed by a human. .It Fl P Do not follow symbolic links, perform a physical file system traversal. @@ -1179,8 +1183,8 @@ directory hierarchy to preserving permissions and access times. .Pp When running as root, one may also wish to preserve file -ownership when copying directory trees. This can -be done with the following commands: +ownership when copying directory trees. +This can be done with the following commands: .Dl cd olddir .Dl pax -rw -pe .\ .../newdir which will copy the contents of diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 80dd7ae0c11f..35c64c889c6a 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: ps.1,v 1.54 2002/06/19 08:11:56 jdolecek Exp $ +.\" $NetBSD: ps.1,v 1.55 2002/09/25 15:18:41 wiz Exp $ .\" .\" Copyright (c) 1980, 1990, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -103,7 +103,8 @@ Change the way the cpu percentage is calculated by using a ``raw'' cpu calculation that ignores ``resident'' time (this normally has no effect). .It Fl e -Display the environment as well. The environment for other +Display the environment as well. +The environment for other users' processes can only be displayed by the super-user. .It Fl h Repeat the information header as often as necessary to guarantee one @@ -161,7 +162,8 @@ Display information about processes attached to the device associated with the standard input. .It Fl t Display information about processes attached to the specified terminal -device. Use an question mark (``?'') for processes not attached to a +device. +Use an question mark (``?'') for processes not attached to a terminal device and a minus sign (``-'') for processes that have been revoked from their terminal device. .It Fl U @@ -360,9 +362,10 @@ to exit is listed as ``\*[Lt]exiting\*[Gt]''. .Pp .Nm will try to locate the processes' argument vector from the user -area in order to print the command name and arguments. This method -is not reliable because a process is allowed to destroy this -information. The ucomm (accounting) keyword will always contain +area in order to print the command name and arguments. +This method is not reliable because a process is allowed to destroy this +information. +The ucomm (accounting) keyword will always contain the real command name as contained in the process structure's p_comm field. .Pp If the command vector cannot be located (usually because it has not diff --git a/bin/pwd/pwd.1 b/bin/pwd/pwd.1 index b3e8c8ba993d..b7412b5653b5 100644 --- a/bin/pwd/pwd.1 +++ b/bin/pwd/pwd.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: pwd.1,v 1.19 2002/02/08 01:21:58 ross Exp $ +.\" $NetBSD: pwd.1,v 1.20 2002/09/25 15:18:41 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -59,7 +59,8 @@ by the shell in the evironment variable if possible. .It Fl P Print the physical path to the current working directory, with symbolic -links in the path resolved. This is the default. +links in the path resolved. +This is the default. .El .Sh EXIT STATUS The diff --git a/bin/rcmd/rcmd.1 b/bin/rcmd/rcmd.1 index 75de83d5ade9..730ccc86bfe8 100644 --- a/bin/rcmd/rcmd.1 +++ b/bin/rcmd/rcmd.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: rcmd.1,v 1.12 2002/03/05 15:09:26 wiz Exp $ +.\" $NetBSD: rcmd.1,v 1.13 2002/09/25 15:18:42 wiz Exp $ .\" .\" Copyright (c) 1997 Matthew R. Green. .\" Copyright (c) 1983, 1990 The Regents of the University of California. @@ -99,8 +99,8 @@ as in .It Fl u The .Fl u -option allows the local username to be specified. Only the superuser -is allowed to use this option. +option allows the local username to be specified. +Only the superuser is allowed to use this option. .It Fl n The .Fl n @@ -186,5 +186,6 @@ The stop signal, .Dv SIGSTOP , will stop the local .Nm -process only. This is arguably wrong, but currently hard to fix for reasons +process only. +This is arguably wrong, but currently hard to fix for reasons too complicated to explain here. diff --git a/bin/rcp/rcp.1 b/bin/rcp/rcp.1 index 3159ccdb9da6..d627f1d47454 100644 --- a/bin/rcp/rcp.1 +++ b/bin/rcp/rcp.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: rcp.1,v 1.12 2001/12/20 20:03:29 wiz Exp $ +.\" $NetBSD: rcp.1,v 1.13 2002/09/25 15:18:42 wiz Exp $ .\" .\" Copyright (c) 1983, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -51,7 +51,8 @@ .Ar directory .Sh DESCRIPTION .Nm -copies files between machines. Each +copies files between machines. +Each .Ar file or .Ar directory diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index 9824a6eb39ac..c147e52b1172 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: sh.1,v 1.49 2002/05/15 19:43:29 bjh21 Exp $ +.\" $NetBSD: sh.1,v 1.50 2002/09/25 15:18:42 wiz Exp $ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -49,12 +49,13 @@ .Op Ar target ... .Ek .Sh DESCRIPTION -Sh is the standard command interpreter for the system. The current version -of +Sh is the standard command interpreter for the system. +The current version of .Nm is in the process of being changed to conform with the .Tn POSIX -1003.2 and 1003.2a specifications for the shell. This version has many +1003.2 and 1003.2a specifications 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 (see .Xr ksh 1 ) . @@ -63,20 +64,24 @@ Only features designated by plus a few Berkeley extensions, are being incorporated into this shell. We expect .Tn POSIX -conformance by the time 4.4 BSD is released. This man page is not intended +conformance by the time 4.4 BSD is released. +This man page is not intended to be a tutorial or a complete specification of the shell. .Ss Overview The shell is a command that reads lines from either a file or the -terminal, interprets them, and generally executes other commands. It is -the program that is running when a user logs into the system (although a -user can select a different shell with the +terminal, interprets them, and generally executes other commands. +It is the program that is running when a user logs into the system +(although a user can select a different shell with the .Xr chsh 1 -command). The shell implements a language that has flow control +command). +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 aid interactive use and +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 +interactive and non-interactive use (shell scripts). +That is, commands can be typed directly to the running shell or can be put into a file and the file can be executed directly by the shell. .Ss Invocation @@ -86,15 +91,17 @@ is connected to a terminal (or if the flag is set), and the .Fl c -option is not present, 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 if it begins with a -dash +option is not present, 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 if it begins with a dash .Sq - , 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 +a login shell. +This is normally done automatically by the system +when the user first logs in. +A login shell first reads commands from the files .Pa /etc/profile and @@ -112,7 +119,8 @@ login time in the .Pa .profile file, and commands that are executed for every shell inside the .Ev ENV -file. To set the +file. +To set the .Ev ENV variable to some file, place the following line in your .Pa .profile @@ -122,13 +130,15 @@ of your home directory .Pp substituting for .Dq .shinit -any filename you wish. Since the +any filename you wish. +Since the .Ev ENV file is read for every invocation of the shell, including shell scripts and non-interactive shells, the following paradigm is useful for restricting commands in the .Ev ENV -file to interactive invocations. Place commands within the +file to interactive invocations. +Place commands within the .Dq case and .Dq esac @@ -150,16 +160,19 @@ below (these commands are described later): If command line arguments besides the options have been specified, then the shell treats the first argument 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 +positional parameters of the shell ($1, $2, etc). +Otherwise, the shell reads commands from its standard input. .Ss Argument List Processing All of the single letter options have a corresponding name that can be used as an argument to the .Fl o -option. The set +option. +The set .Fl o name is provided next to the single letter option in -the description below. Specifying a dash +the description below. +Specifying a dash .Dq - turns the option on, while using a plus .Dq + @@ -180,8 +193,7 @@ Don't overwrite existing files with .It Fl e Em errexit If not interactive, exit immediately if any untested command fails. The exit status of a command is considered to be -explicitly tested if the command is used to control -an +explicitly tested if the command is used to control an .Ic if , .Ic elif , .Ic while , @@ -195,19 +207,19 @@ operator. .It Fl f Em noglob Disable pathname expansion. .It Fl n Em noexec -If not interactive, read commands but do not execute them. This is useful -for checking the syntax of shell scripts. +If not interactive, read commands but do not execute them. +This is useful for checking the syntax of shell scripts. .It Fl u Em nounset Write a message to standard error when attempting to expand a variable that is not set, and if the shell is not interactive, exit immediately. .It Fl v Em verbose -The shell writes its input to standard error as it is read. Useful for -debugging. +The shell writes its input to standard error as it is read. +Useful for debugging. .It Fl x Em xtrace -Write each command to standard error (preceded -by a +Write each command to standard error (preceded by a .Sq +\ ) -before it is executed. Useful for debugging. +before it is executed. +Useful for debugging. .It Fl q Em quietprofile If the .Fl v @@ -228,7 +240,8 @@ Force the shell to behave interactively. Turn on job control (set automatically when interactive). .It Fl s Em stdin Read commands from standard input (set automatically if no file arguments -are present). This option has no effect when set after the shell has +are present). +This option has no effect when set after the shell has already started running (i.e. with .Ic set ) . .It Fl V Em vi @@ -253,7 +266,8 @@ words at whitespace (blanks and tabs), and at certain sequences of characters that are special to the shell called .Dq operators . There are two types of operators: control operators and redirection -operators (their meaning is discussed later). Following is a list of operators: +operators (their meaning is discussed later). +Following is a list of operators: .Bl -ohang -offset indent .It "Control operators:" .Dl \*[Am] \*[Am]\*[Am] \&( \&) \&; ;; | || \*[Lt]newline\*[Gt] @@ -262,9 +276,9 @@ operators (their meaning is discussed later). Following is a list of operators: .El .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, matched double quotes, and -backslash. +words to the shell, such as operators, whitespace, or keywords. +There are three types of quoting: matched single quotes, +matched double quotes, and backslash. .Ss Backslash A backslash preserves the literal meaning of the following character, with the exception of @@ -291,7 +305,8 @@ Otherwise it remains literal. .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 while while while while while -offset indent .It ! Ta elif Ta fi Ta while Ta case .It else Ta for Ta then Ta { Ta } @@ -302,11 +317,12 @@ Their meaning is discussed later. .Ss Aliases An alias is a name and corresponding value set using the .Xr alias 1 -builtin command. Whenever a reserved word may occur (see above), +builtin 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. For example, -if there is an alias called +checks the word to see if it matches an alias. +If it does, it replaces it in the input stream with its value. +For example, if there is an alias called .Dq lf with the value .Dq "ls -F" , @@ -320,16 +336,18 @@ would become .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. +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 .Tn POSIX -1003.2 document). Essentially though, a line is read and if the first +1003.2 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 +then the shell has recognized a 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 @@ -346,8 +364,9 @@ The remaining words are expanded as described in the section called .Dq Expansions , and the first remaining word is considered the command name and the -command is located. The remaining words are considered the arguments of -the command. If no command name resulted, then the +command is located. +The remaining words are considered the arguments of the command. +If no command name resulted, then the .Dq name=value variable assignments recognized in item 1 affect the current shell. .It @@ -355,15 +374,18 @@ Redirections are performed as described in 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 used for redirection is: +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] Va redir-op Ar file .Pp where .Va redir-op -is one of the redirection operators mentioned previously. Following is a -list of the possible redirections. The +is one of the redirection operators mentioned previously. +Following is a list of the possible redirections. +The .Bq n is an optional number, as in .Sq 3 @@ -404,7 +426,8 @@ The following redirection is often called a .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 as specified on the initial line is +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 expansion (as described in the section on @@ -416,34 +439,38 @@ instead of then leading tabs in the here-doc-text are stripped. .Ss Search and Execution There are three types of commands: shell functions, builtin commands, and -normal programs -- and the command is searched for (by name) in that -order. They each are executed in a different way. +normal programs -- and the command is searched for (by name) in that order. +They each are executed in a different way. .Pp When a shell function is executed, all of the shell positional parameters (except $0, which remains unchanged) are set to the arguments of the shell -function. The variables which are explicitly placed in the environment of +function. +The variables which are explicitly placed in the environment of the command (by placing assignments to them before the function name) are -made local to the function and are set to the values given. Then the -command given in the function definition is executed. The positional -parameters are restored to their original values when the command -completes. This all occurs within the current shell. +made local to the function and are set to the values given. +Then the command given in the function definition is executed. +The positional parameters are restored to their original values +when the command completes. +This all occurs within the current shell. .Pp Shell builtins are executed internally to the shell, without spawning a new process. .Pp Otherwise, if the command name doesn't match a function or builtin, the command is searched for as a normal program in the filesystem (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 +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 "magic number" whose .Tn ASCII representation is "#!", so .Xr execve 2 returns .Er ENOEXEC -then) the shell will interpret the program in a subshell. The child shell -will reinitialize itself in this case, so that the effect will be as if a +then) the shell will interpret the program in a subshell. +The child shell will reinitialize itself in this case, +so that the effect will be as if a new shell had been invoked to handle the ad-hoc shell script, except that the location of hashed commands located in the parent shell will be remembered by the child. @@ -453,7 +480,8 @@ misleadingly and sporadically refer to a shell script without a magic number as a "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 builtin command by that name. +function by that name. +Then it looks for a builtin command by that name. If a builtin command is not found, one of two things happen: .Bl -enum .It @@ -462,17 +490,21 @@ 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 directory name. The current directory may be indicated +variable should be a series of entries separated by colons. +Each entry consists of a directory name. +The current directory may be indicated implicitly by an empty directory name, 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 builtin commands return exit codes, as does an executed shell function. @@ -499,7 +531,8 @@ simple command executed by the command. A pipeline is a sequence of one or more commands separated 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: @@ -507,7 +540,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 both of a command is +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. .Pp @@ -517,13 +551,14 @@ waits for all commands to complete. If the reserved word ! 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 the last command returns zero, the exit status +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: +takes place before redirection, it can be modified by redirection. +For example: .Pp .Dl $ command1 2\*[Gt]\*[Am]1 | command2 .Pp @@ -553,8 +588,9 @@ command is set to .Ss Lists -- Generally Speaking A list is a sequence of zero or more commands separated by newlines, semicolons, or ampersands, and optionally terminated by one of these three -characters. The commands in a list are executed in the order they are -written. If command is followed by an ampersand, the shell starts the +characters. +The commands in a list are executed in the order they are written. +If command is followed by an ampersand, the shell starts the command and immediately proceed onto the next command; otherwise it waits for the command to terminate before proceeding to the next one. .Ss Short-Circuit List Operators @@ -591,7 +627,8 @@ done .Ed .Pp The two lists are executed repeatedly while the exit status of the -first list is zero. The until command is similar, but has the word +first list is zero. +The until command is similar, but has the word until in place of while, which causes it to repeat until the exit status of the first list is zero. .Pp @@ -603,7 +640,8 @@ done .Ed .Pp The words are expanded, and then the list is executed repeatedly with the -variable set to each word in turn. do and done may be replaced with +variable set to each word in turn. +do and done may be replaced with .Dq { and .Dq } . @@ -639,11 +677,11 @@ or .Pp .Dl { list; } .Pp -The first of these executes the commands in a subshell. Builtin commands -grouped into a (list) will not affect the current shell. The second form -does not fork another shell so is slightly more efficient. Grouping -commands together this way allows you to redirect their output as though -they were one program: +The first of these executes the commands in a subshell. +Builtin commands grouped into a (list) will not affect the current shell. +The second form does not fork another shell so is slightly more efficient. +Grouping commands together this way allows you to redirect +their output as though they were one program: .Pp .Bd -literal -offset indent { echo -n \*q hello \*q ; echo \*q world" ; } \*[Gt] greeting @@ -660,15 +698,15 @@ The syntax of a function definition is .Dl 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 enclosed between +installs a function named name and returns an exit status of zero. +The command is normally a list enclosed between .Dq { and .Dq } . .Pp Variables may be declared to be local to a function by using a local -command. This should appear as the first statement of a function, and the -syntax is +command. +This should appear as the first statement of a function, and the syntax is .Pp .Dl local [ variable | - ] ... .Pp @@ -676,8 +714,9 @@ Local is implemented as a builtin command. .Pp 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 uses dynamic scoping, so that if you make the variable x local to +scope, if there is one. +Otherwise, the variable is initially unset. +The shell uses dynamic scoping, so that if you make the variable x local to function f, which then calls function g, references to the variable x made inside g will refer to the variable x declared inside f, not to the global variable named x. @@ -694,31 +733,37 @@ The syntax of the return command is .Pp .Dl return [ exitstatus ] .Pp -It terminates the currently executing function. Return is -implemented as a builtin command. +It terminates the currently executing function. +Return is implemented as a builtin 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 turns all the environment -variables into shell variables. New variables can be set using the form +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 .Pp .Dl name=value .Pp Variables set by the user must have a name consisting solely of alphabetics, numerics, and underscores - the first of which must not be -numeric. A parameter can also be denoted by a number or a special +numeric. +A parameter can also be denoted by a number or a special character as explained below. .Ss Positional Parameters -A positional parameter is a parameter denoted by a number (n \*[Gt] 0). The -shell sets these initially to the values of its command line arguments -that follow the name of the shell script. The +A positional parameter is a parameter denoted by a number (n \*[Gt] 0). +The shell sets these initially to the values of its command line arguments +that follow the name of the shell script. +The .Ic set builtin 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 next to its character. +characters. +The value of the parameter is listed next to its character. .Bl -tag -width thinhyphena .It * -Expands to the positional parameters, starting from one. When the +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 @@ -727,12 +772,13 @@ variable, or by a \*[Lt]space\*[Gt] if .Ev IFS is unset. .It @ -Expands to the positional parameters, starting from one. When -the expansion occurs within double-quotes, each positional +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 expansion of @ generates zero arguments, even when @ is -double-quoted. What this basically means, for example, is +double-quoted. +What this basically means, for example, is if $1 is .Dq abc and $2 is @@ -755,13 +801,12 @@ option names concatenated into a string) as specified on invocation, by the set builtin command, or implicitly by the shell. .It $ -Expands to the process ID of the invoked shell. A subshell -retains the same value of $ as its parent. +Expands to the process ID of the invoked shell. +A subshell retains the same value of $ as its parent. .It ! Expands to the process ID of the most recent background -command executed from the current shell. For a -pipeline, the process ID is that of the last command in the -pipeline. +command executed from the current shell. +For a pipeline, the process ID is that of the last command in the pipeline. .It 0 (Zero.) Expands to the name of the shell or shell script. .El @@ -771,8 +816,10 @@ 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 splitting or pathname expansion that can -create multiple fields from a single word. The single exception to this +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 the expansion of the special parameter @ within double-quotes, as was described above. .Pp @@ -798,10 +845,11 @@ The $ character is used to introduce parameter expansion, command substitution, or arithmetic evaluation. .Ss Tilde Expansion (substituting a user's home directory) A word beginning with an unquoted tilde character (~) is -subjected to tilde expansion. All the characters up to +subjected to tilde expansion. +All the characters up to a slash (/) or the end of the word are treated as a username -and are replaced with the user's home directory. If the -username is missing (as in +and are replaced with the user's home directory. +If the username is missing (as in .Pa ~/foobar ) , the tilde is replaced with the value of the .Va HOME @@ -830,12 +878,10 @@ The parameter name or symbol can be enclosed in braces, which are optional except for positional parameters with more than one digit or when parameter is followed by a character that could be interpreted as part of the name. -If a parameter expansion occurs inside -double-quotes: +If a parameter expansion occurs inside double-quotes: .Bl -enum .It -Pathname expansion is not performed on the results of the -expansion. +Pathname expansion is not performed on the results of the expansion. .It Field splitting is not performed on the results of the expansion, with the exception of @. @@ -845,21 +891,26 @@ In addition, a parameter expansion can be modified by using one of the following formats. .Bl -tag -width aaparameterwordaaaaa .It ${parameter:-word} -Use Default Values. If parameter is unset or null, the expansion of word +Use Default Values. +If parameter is unset or null, the expansion of word is substituted; otherwise, the value of parameter is substituted. .It ${parameter:=word} -Assign Default Values. If parameter is unset or null, the expansion of -word is assigned to parameter. In all cases, the final value of parameter -is substituted. Only variables, not positional parameters or special +Assign Default Values. +If parameter is unset or null, the expansion of +word is assigned to parameter. +In all cases, the final value of parameter is substituted. +Only variables, not positional parameters or special parameters, can be assigned in this way. .It ${parameter:?[word]} -Indicate Error if Null or Unset. If parameter is unset or null, the +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 interactive -shell need not exit. +is written to standard error and the shell exits with a nonzero exit status. +Otherwise, the value of parameter is substituted. +An interactive shell need not exit. .It ${parameter:+word} -Use Alternative Value. If parameter is unset or null, null is +Use Alternative Value. +If parameter is unset or null, null is substituted; otherwise, the expansion of word is substituted. .El .Pp @@ -868,12 +919,13 @@ 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 aaparameterwordaaaaa .It ${#parameter} -String Length. The length in characters of -the value of parameter. +String Length. +The length in characters of the value of parameter. .El .Pp The following four varieties of parameter expansion provide for substring -processing. In each case, pattern matching notation (see Shell Patterns), +processing. +In each case, pattern matching notation (see Shell Patterns), rather than regular expression notation, is used to evaluate the patterns. If parameter is * or @, the result of the expansion is unspecified. Enclosing the full parameter expansion string in double-quotes does not @@ -881,26 +933,30 @@ cause the following four varieties of pattern characters to be quoted, whereas quoting characters within the braces has this effect. .Bl -tag -width aaparameterwordaaaaa .It ${parameter%word} -Remove Smallest Suffix Pattern. The word is expanded to produce a -pattern. The parameter expansion then results in parameter, with 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 ${parameter%%word} -Remove Largest Suffix Pattern. The word is expanded to produce a pattern. +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 ${parameter#word} -Remove Smallest Prefix Pattern. The word is expanded to produce a -pattern. The parameter expansion then results in parameter, with 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 ${parameter##word} -Remove Largest Prefix Pattern. The word is expanded to produce a pattern. +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 -the command is enclosed as follows: +place of the command name itself. +Command substitution occurs when the command is enclosed as follows: .Pp .Dl $(command) .Pp @@ -915,21 +971,22 @@ version The shell expands the command substitution by executing command in a subshell environment and replacing the command substitution with the standard output of the command, removing sequences of one or more -\*[Lt]newline\*[Gt]s at the end of the substitution. (Embedded \*[Lt]newline\*[Gt]s before +\*[Lt]newline\*[Gt]s at the end of the substitution. +(Embedded \*[Lt]newline\*[Gt]s before the end of the output are not removed; however, during field splitting, they may be translated into \*[Lt]space\*[Gt]s, depending on the value of .Ev IFS and quoting that is in effect.) .Ss Arithmetic Expansion Arithmetic expansion provides a mechanism for evaluating an arithmetic -expression and substituting its value. The format for arithmetic -expansion is as follows: +expression and substituting its value. +The format for arithmetic expansion is as follows: .Pp .Dl $((expression)) .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 -shell expands all tokens in the expression for parameter expansion, +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 Next, the shell treats this as an arithmetic expression and @@ -948,37 +1005,43 @@ expansion and command substitution into fields. Unless the .Fl f flag 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 process of expansion replaces the word with the names of all +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. There are two restrictions on +string that matches the specified pattern. +There are two restrictions on this: first, a pattern cannot match a string containing a slash, and second, a pattern cannot match a string starting with a period unless the -first character of the pattern is a period. The next section describes the +first character of the pattern is a period. +The next section describes the patterns used for both Pathname Expansion and the .Ic case command. .Ss Shell Patterns A pattern consists of normal characters, which match themselves, -and meta-characters. The meta-characters are +and meta-characters. +The meta-characters are .Dq ! , .Dq * , .Dq ? , and .Dq [ . -These characters lose their special meanings if they are quoted. When -command or variable substitution is performed and the dollar sign or back -quotes are not double quoted, the value of the variable or the output of +These characters lose their special meanings if they are quoted. +When command or variable substitution is performed +and the dollar sign or back quotes are not double quoted, +the value of the variable or the output of the command is scanned for these characters and they are turned into meta-characters. .Pp An asterisk .Pq Dq * -matches any string of characters. A question mark matches any single -character. A left bracket +matches any string of characters. +A question mark matches any single character. +A left bracket .Pq Dq \&[ -introduces a character class. The end of -the character class is indicated by a +introduces a character class. +The end of the character class is indicated by a .Pq Dq \&] ; if the .Dq \&] @@ -986,20 +1049,23 @@ is missing then the .Dq \&[ matches a .Dq \&[ -rather than introducing a character class. A character class matches any -of the characters between the square brackets. A range of characters may -be specified using a minus sign. The character class may be complemented +rather than introducing a character class. +A character class matches any of the characters between the square brackets. +A range of characters may be specified using a minus sign. +The character class may be complemented by making an exclamation point the first character of the character class. .Pp To include a .Dq \&] in a character class, make it the first character listed (after the .Dq \&! , -if any). To include a minus sign, make it the first or last character listed +if any). +To include a minus sign, make it the first or last character listed. .Ss Builtins This section lists the builtin commands which are builtin because they need to perform some operation that can't be performed by a separate -process. In addition to these, there are several other commands that may +process. +In addition to these, there are several other commands that may be builtin for efficiency (e.g. .Xr printf 1 , .Xr echo 1 , @@ -1021,7 +1087,8 @@ If just .Ar name is specified, the value of the alias .Ar name -is printed. With no arguments, the +is printed. +With no arguments, the .Ic alias builtin prints the names and values of all defined aliases (see @@ -1030,7 +1097,8 @@ names and values of all defined aliases (see Continue the specified jobs (or the current job if no jobs are given) in the background. .It command Ar command Ar arg ... -Execute the specified builtin command. (This is useful when you +Execute the specified builtin command. +(This is useful when you have a shell function with the same name as a builtin command.) .It cd Op Ar directory Switch to the specified directory (default @@ -1044,7 +1112,8 @@ command or the shell variable is set and the directory name does not begin with a slash, then the directories listed in .Ev CDPATH -will be searched for the specified directory. The format of +will be searched for the specified directory. +The format of .Ev CDPATH is the same as that of .Ev PATH . @@ -1052,30 +1121,34 @@ In an interactive shell, the .Ic cd command will print out the name of the directory that it actually switched to if this is different from the name -that the user gave. These may be different either because the +that the user gave. +These may be different either because the .Ev CDPATH mechanism was used or because a symbolic link was crossed. .It eval Ar string ... -Concatenate all the arguments with spaces. Then re-parse and execute -the command. +Concatenate all the arguments with spaces. +Then re-parse and execute the command. .It exec Op Ar command arg ... Unless command is omitted, the shell process is replaced with the specified program (which must be a real program, not a shell builtin or -function). Any redirections on the +function). +Any redirections on the .Ic exec command are marked as permanent, so that they are not undone when the .Ic exec command finishes. .It exit Op Ar exitstatus -Terminate the shell process. If +Terminate the shell process. +If .Ar exitstatus is given it is used as the exit status of the shell; otherwise the exit status of the preceding command is used. .It export Ar name ... .It export Fl p The specified names are exported so that they will appear in the -environment of subsequent commands. The only way to un-export a variable -is to unset it. The shell allows the value of a variable to be set at the +environment of subsequent commands. +The only way to un-export a variable is to unset it. +The shell allows the value of a variable to be set at the same time it is exported by writing .Pp .Dl export name=value @@ -1100,26 +1173,29 @@ builtin lists, or edits and re-executes, commands previously entered to an interactive shell. .Bl -tag -width 5n .It Fl e No editor -Use the editor named by editor to edit the commands. The -editor string is a command name, subject to search via the +Use the editor named by editor to edit the commands. +The editor string is a command name, subject to search via the .Ev PATH -variable. The value in the +variable. +The value in the .Ev FCEDIT variable is used as a default when .Fl e -is not specified. If +is not specified. +If .Ev FCEDIT is null or unset, the value of the .Ev EDITOR -variable is used. If +variable is used. +If .Ev EDITOR is null or unset, .Xr ed 1 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 sequence indicated by the first and last operands, as -affected by +List the commands rather than invoking an editor on them. +The commands are written in the sequence indicated by +the first and last operands, as affected by .Fl r , with each command preceded by the command number. .It Fl n @@ -1135,10 +1211,12 @@ nor Re-execute the command without invoking an editor. .It first .It last -Select the commands to list or edit. The number of previous commands that +Select the commands to list or edit. +The number of previous commands that can be accessed are determined by the value of the .Ev HISTSIZE -variable. The value of first or last or both are one of the following: +variable. +The value of first or last or both are one of the following: .Bl -tag -width 5n .It [+]number A positive number representing a command number; command numbers can be @@ -1147,12 +1225,13 @@ displayed with the option. .It Fl number A negative decimal number representing the command that was executed -number of commands previously. For example, -1 is the immediately -previous command. +number of commands previously. +For example, \-1 is the immediately previous command. .El .It string A string indicating the most recently entered command that begins with -that string. If the old=new operand is not also specified with +that string. +If the old=new operand is not also specified with .Fl s , the string form of the first operand cannot contain an embedded equal sign. .El @@ -1177,7 +1256,8 @@ command, not to be confused with the .Pp The first argument should be a series of letters, each of which may be optionally followed by a colon to indicate that the option requires an -argument. The variable specified is set to the parsed option. +argument. +The variable specified is set to the parsed option. .Pp The .Ic getopts @@ -1188,7 +1268,8 @@ utility due to its handling of arguments containing whitespace. The .Ic getopts builtin may be used to obtain options and their arguments -from a list of parameters. When invoked, +from a list of parameters. +When invoked, .Ic getopts places the value of the next option from the option string in the list in the shell variable specified by @@ -1197,7 +1278,8 @@ and it's index in the shell variable .Ev OPTIND . When the shell is invoked, .Ev OPTIND -is initialized to 1. For each option that requires an argument, the +is initialized to 1. +For each option that requires an argument, the .Ic getopts builtin will place it in the shell variable .Ev OPTARG . @@ -1211,8 +1293,8 @@ will be unset. is a string of recognized option letters (see .Xr getopt 3 ) . If a letter is followed by a colon, the option is expected to have an -argument which may or may not be separated from it by white space. If an -option character is not found where expected, +argument which may or may not be separated from it by white space. +If an option character is not found where expected, .Ic getopts will set the variable .Va var @@ -1221,8 +1303,8 @@ to a .Ic getopts will then unset .Ev OPTARG -and write output to standard error. By specifying a colon as the -first character of +and write output to standard error. +By specifying a colon as the first character of .Va optstring all errors will be ignored. .Pp @@ -1269,11 +1351,12 @@ cmd \-a \-carg \-\- file file .Ed .It hash Fl rv Ar command ... The shell maintains a hash table which remembers the -locations of commands. With no arguments whatsoever, +locations of commands. +With no arguments whatsoever, the .Ic hash -command prints out the contents of this table. Entries which have not -been looked at since the last +command prints out the contents of this table. +Entries which have not been looked at since the last .Ic cd command are marked with an asterisk; it is possible for these entries to be invalid. @@ -1281,9 +1364,11 @@ to be invalid. With arguments, the .Ic hash command removes the specified commands from the hash table (unless -they are functions) and then locates them. With the +they are functions) and then locates them. +With the .Fl v -option, hash prints the locations of the commands as it finds them. The +option, hash prints the locations of the commands as it finds them. +The .Fl r option causes the hash command to delete all the entries in the hash table except for functions. @@ -1296,12 +1381,12 @@ argument is omitted, the current job is used. This command lists out all the background processes which are children of the current shell process. .It pwd -Print the current directory. The builtin command may -differ from the program of the same name because the +Print the current directory. +The builtin command may differ from the program of the same name because the builtin command remembers what the current directory -is rather than recomputing it each time. This makes -it faster. However, if the current directory is -renamed, the builtin version of +is rather than recomputing it each time. +This makes it faster. +However, if the current directory is renamed, the builtin version of .Ic pwd will continue to print the old name for the directory. .It Xo read Op Fl p Ar prompt @@ -1311,16 +1396,18 @@ will continue to print the old name for the directory. .Xc The prompt 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 is deleted from the +option is specified 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 word splitting -above, and the pieces are assigned to the variables in order. If there are -more pieces than variables, the remaining pieces (along with the -characters in +above, and the pieces are assigned to the variables in order. +If there are more pieces than variables, the remaining pieces +(along with the characters in .Ev IFS -that separated them) are assigned to the last variable. If there are more -variables than pieces, the remaining variables are assigned the null -string. The +that separated them) are assigned to the last variable. +If there are more variables than pieces, +the remaining variables are assigned the null string. +The .Ic read builtin will indicate success unless EOF is encountered on input, in which case failure is returned. @@ -1330,12 +1417,14 @@ By default, unless the option is specified, the backslash .Dq \e acts as an escape character, causing the following character to be treated -literally. If a backslash is followed by a newline, the backslash and the +literally. +If a backslash is followed by a newline, the backslash and the newline will be deleted. .It readonly Ar name ... .It readonly Fl p The specified names are marked as read only, so that they cannot be -subsequently modified or unset. The shell allows the value of a variable +subsequently modified or unset. +The shell allows the value of a variable to be set at the same time it is marked read only by writing .Pp .Dl readonly name=value @@ -1355,23 +1444,24 @@ The .Ic set command performs three different functions. .Pp -With no arguments, it lists the values of all shell -variables. +With no arguments, it lists the values of all shell variables. .Pp If options are given, it sets the specified option -flags, or clears them as described in the section -called +flags, or clears them as described in the section called .Sx Argument List Processing . .Pp The third use of the set command is to set the values of the shell's -positional parameters to the specified args. To change the positional +positional parameters to the specified args. +To change the positional parameters without changing any options, use .Dq -- -as the first argument to set. If no args are present, the set command +as the first argument to set. +If no args are present, the set command will clear all the positional parameters (equivalent to executing .Dq shift $# . ) .It setvar Ar variable Ar value -Assigns value to variable. (In general it is better to write +Assigns value to variable. +(In general it is better to write variable=value rather than using .Ic setvar . .Ic setvar @@ -1379,7 +1469,8 @@ is intended to be used in functions that assign values to variables whose names are passed as parameters.) .It shift Op Ar n -Shift the positional parameters n times. A +Shift the positional parameters n times. +A .Ic shift sets the value of .Va $1 @@ -1392,7 +1483,8 @@ to the value of and so on, decreasing the value of .Va $# -by one. If there are zero positional parameters, +by one. +If there are zero positional parameters, .Ic shift does nothing. .It Xo trap @@ -1403,8 +1495,8 @@ does nothing. .Ar signal ... .Xc Cause the shell to parse and execute action when any of the specified -signals are received. The signals are specified by signal number or as -the name of the signal. +signals are received. +The signals are specified by signal number or as the name of the signal. If .Ar signal is @@ -1416,7 +1508,8 @@ With .Ar action omitted or set to `-' the specified signals are set to their default action. When the shell forks off a subshell, it resets trapped (but not ignored) -signals to the default action. The +signals to the default action. +The .Ic trap command has no effect on signals that were ignored on entry to the shell. @@ -1449,9 +1542,11 @@ Ignore signals INT QUIT TSTP USR1 Print date upon receiving signal INT .It type Op Ar name ... Interpret each name as a command and print the resolution of the command -search. Possible resolutions are: +search. +Possible resolutions are: shell keyword, alias, shell builtin, -command, tracked alias and not found. For aliases the alias expansion is +command, tracked alias and not found. +For aliases the alias expansion is printed; for commands and tracked aliases the complete pathname of the command is printed. .It ulimit Xo @@ -1459,7 +1554,8 @@ command is printed. .Op Fl a \*(Ba Fl tfdscmlpn Op Ar value .Xc Inquire about or set the hard or soft limits on processes or set new -limits. The choice between hard limit (which no process is allowed to +limits. +The choice between hard limit (which no process is allowed to violate, and which may not be raised once it has been lowered) and soft limit (which causes processes to be signaled but not necessarily killed, and which may be raised) is made with these flags: @@ -1467,12 +1563,13 @@ and which may be raised) is made with these flags: .It Fl H set or inquire about hard limits .It Fl S -set or inquire about soft limits. If neither +set or inquire about soft limits. +If neither .Fl H nor .Fl S -is specified, the soft limit is displayed or both limits are set. If both -are specified, the last one wins. +is specified, the soft limit is displayed or both limits are set. +If both are specified, the last one wins. .El .Pp .Bl -tag -width Fl @@ -1507,7 +1604,8 @@ show or set the limit on the number files a process can have open at once .El .Pp If none of these is specified, it is the limit on file size that is shown -or set. If value is specified, the limit is set to that number; otherwise +or set. +If value is specified, the limit is set to that number; otherwise the current limit is displayed. .Pp Limits of an arbitrary process can be displayed or set using the @@ -1517,24 +1615,26 @@ utility. .It umask Op Ar mask Set the value of umask (see .Xr umask 2 ) -to the specified octal value. If the argument is omitted, the umask value -is printed. +to the specified octal value. +If the argument is omitted, the umask value is printed. .It unalias Xo .Op Fl a .Op Ar name .Xc If .Ar name -is specified, the shell removes that alias. If +is specified, the shell removes that alias. +If .Fl a is specified, all aliases are removed. .It unset Ar name ... -The specified variables and functions are unset and unexported. If a given -name corresponds to both a variable and a function, both the variable and -the function are unset. +The specified variables and functions are unset and unexported. +If a given name corresponds to both a variable and a function, both +the variable and the function are unset. .It wait Op Ar job Wait for the specified job to complete and return the exit status of the -last process in the job. If the argument is omitted, wait for all jobs to +last process in the job. +If the argument is omitted, wait for all jobs to complete and the return an exit status of zero. .El .Ss Command Line Editing @@ -1545,22 +1645,27 @@ and the command history (see .Ic fc in .Sx Builtins ) -can be edited using vi-mode command-line editing. This mode uses commands, -described below, similar to a subset of those described in the vi man -page. The command +can be edited using vi-mode command-line editing. +This mode uses commands, described below, +similar to a subset of those described in the vi man page. +The command .Ql set -o vi -enables vi-mode editing and place sh into vi insert mode. With vi-mode -enabled, sh can be switched between insert mode and command mode. The -editor is not described in full here, but will be in a later document. +enables vi-mode editing and place sh into vi insert mode. +With vi-mode +enabled, sh can be switched between insert mode and command mode. +The editor is not described in full here, but will be in a later document. It's similar to vi: typing .Aq ESC -will throw you into command VI command mode. Hitting +will throw you into command VI command mode. +Hitting .Aq return while in command mode will pass the line to the shell. .Sh EXIT STATUS Errors that are detected by the shell, such as a syntax error, will cause the -shell to exit with a non-zero exit status. If the shell is not an -interactive shell, the execution of the shell file will be aborted. Otherwise +shell to exit with a non-zero exit status. +If the shell is not an +interactive shell, the execution of the shell file will be aborted. +Otherwise the shell will return the exit status of the last command executed, or if the exit builtin is used with a numeric argument, it will return the argument. @@ -1574,7 +1679,8 @@ from the user's login directory in the password file This environment variable also functions as the default argument for the cd builtin. .It Ev PATH -The default search path for executables. See the above section +The default search path for executables. +See the above section .Sx Path Search . .It Ev CDPATH The search path used with the cd builtin. @@ -1588,14 +1694,16 @@ in the files specified by the .Ev MAILPATH or the .Ev MAIL -file. If set to 0, the check will occur at each prompt. +file. +If set to 0, the check will occur at each prompt. .It Ev MAILPATH A colon .Dq \&: separated list of file names, for the shell to check for incoming mail. This environment setting overrides the .Ev MAIL -setting. There is a maximum of 10 mailboxes that can be monitored at once. +setting. +There is a maximum of 10 mailboxes that can be monitored at once. .It Ev PS1 The primary prompt string, which defaults to .Dq $ \ , @@ -1605,12 +1713,14 @@ unless you are the superuser, in which case it defaults to The secondary prompt string, which defaults to .Dq \*[Gt] \ . .It Ev IFS -Input Field Separators. This is normally set to \*[Lt]space\*[Gt] \*[Lt]tab\*[Gt] and +Input Field Separators. +This is normally set to \*[Lt]space\*[Gt] \*[Lt]tab\*[Gt] and \*[Lt]newline\*[Gt]. See the .Sx White Space Splitting section for more details. .It Ev TERM -The default terminal setting for the shell. This is inherited by +The default terminal setting for the shell. +This is inherited by children of the shell, and is used in the history editing modes. .It Ev HISTSIZE The number of lines in the history buffer for the shell. diff --git a/bin/sleep/sleep.1 b/bin/sleep/sleep.1 index ae8da99719d4..9b0e6326a066 100644 --- a/bin/sleep/sleep.1 +++ b/bin/sleep/sleep.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: sleep.1,v 1.15 2002/02/08 01:22:00 ross Exp $ +.\" $NetBSD: sleep.1,v 1.16 2002/09/25 15:18:43 wiz Exp $ .\" .\" Copyright (c) 1990, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -58,10 +58,9 @@ below). Note: The .Nx .Nm -command will accept and honor a non-integer number of specified -seconds. This is a non-portable extension, and its use will nearly -guarantee that a shell script will not execute properly on another -system. +command will accept and honor a non-integer number of specified seconds. +This is a non-portable extension, and its use will nearly guarantee that +a shell script will not execute properly on another system. .Sh EXIT STATUS The .Nm @@ -82,7 +81,8 @@ number seconds later: .Dl (sleep 1800; sh command_file \*[Gt]\*[Am] errors)\*[Am] .Pp This incantation would wait a half hour before -running the script command_file. (See the +running the script command_file. +(See the .Xr at 1 utility.) .Pp diff --git a/bin/stty/stty.1 b/bin/stty/stty.1 index 56dd59e5b529..dab8241d2383 100644 --- a/bin/stty/stty.1 +++ b/bin/stty/stty.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: stty.1,v 1.24 2002/02/08 01:22:01 ross Exp $ +.\" $NetBSD: stty.1,v 1.25 2002/09/25 15:18:43 wiz Exp $ .\" .\" Copyright (c) 1990, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -74,8 +74,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 -using the +rather than using standard input. +The file is opened using the .Dv O_NONBLOCK flag of .Fn open , @@ -94,7 +94,8 @@ The following arguments are available to set the terminal characteristics: .Ss Control Modes 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 @@ -216,11 +217,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 @@ -321,19 +324,21 @@ is disabled. .It Cm echoctl Pq Fl echoctl If .Cm echoctl -is set, echo control characters as ^X. Otherwise control characters -echo as themselves. +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. +For printing terminals. +If set, echo erased characters backwards within ``\\'' +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 -terminal output. +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 alternative word erase algorithm when processing .Dv WERASE @@ -346,9 +351,9 @@ 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 -writes return an error if Carrier Detect is low (and Carrier is not being -ignored with the +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 flag.) .It Cm flusho Pq Fl flusho @@ -411,14 +416,12 @@ Non-Canonical mode input processing .Ss Combination Modes .Bl -tag -width Fl .It Ar saved settings -Set the current terminal -characteristics to the saved settings +Set the current terminal characteristics to the saved settings produced by the .Fl g option. .It Cm evenp No or Cm parity -Enable parenb and cs7; disable -parodd. +Enable parenb and cs7; disable parodd. .It Cm oddp Enable parenb, cs7, and parodd. .It Fl parity , evenp , oddp @@ -432,8 +435,7 @@ Reset .Dv ERASE and .Dv KILL -characters -back to system defaults. +characters back to system defaults. .It Cm sane Resets all modes to reasonable values for interactive terminal use. .It Cm tty @@ -445,7 +447,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. @@ -477,9 +480,10 @@ performed by either the terminal hardware or by the remote side connected to a pty. .It Cm raw Pq Fl raw 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 -terminal driver no longer has a single +is performed. +If unset, change the modes of the terminal to some reasonable +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 .Cm raw . @@ -595,7 +599,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/systrace/systrace.1 b/bin/systrace/systrace.1 index 7ddb17bb1c63..dfea5b7bacb2 100644 --- a/bin/systrace/systrace.1 +++ b/bin/systrace/systrace.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: systrace.1,v 1.12 2002/08/28 03:52:46 itojun Exp $ +.\" $NetBSD: systrace.1,v 1.13 2002/09/25 15:18:43 wiz Exp $ .\" $OpenBSD: systrace.1,v 1.27 2002/08/05 23:27:53 provos Exp $ .\" .\" Copyright 2002 Niels Provos @@ -49,15 +49,18 @@ The .Nm utility monitors and controls an application's access to the system by -enforcing access policies for system calls. The +enforcing access policies for system calls. +The .Nm utility might be used to trace an untrusted application's access to -the system. Alternatively, it might be used to protect the system +the system. +Alternatively, it might be used to protect the system from software bugs (such as buffer overflows) by constraining a daemon's access to the system. .Pp The access policy can be generated interactively or obtained from a -policy file. Operations not covered by the policy raise an alarm and +policy file. +Operations not covered by the policy raise an alarm and allow an user to refine the currently configured policy. .Pp The options are as follows: @@ -71,10 +74,10 @@ Automatically generate a policy that allows every operation the application executes. The created policy functions as a base that can be refined. .It Fl u -Do not perform aliasing on system call names. Aliasing is enabled -by default to group similar system calls into a single compound -name. For example, system calls that read from the file system -like +Do not perform aliasing on system call names. +Aliasing is enabled by default to group similar system calls into a +single compound name. +For example, system calls that read from the file system like .Fn lstat and .Fn access @@ -130,7 +133,8 @@ is used to return an .Xr errno 2 value to the system call when using a .Va deny -action. The values +action. +The values .Do inherit .Dc diff --git a/bin/test/test.1 b/bin/test/test.1 index 331073fd41c1..750c85e5b547 100644 --- a/bin/test/test.1 +++ b/bin/test/test.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: test.1,v 1.17 2002/02/08 01:22:01 ross Exp $ +.\" $NetBSD: test.1,v 1.18 2002/09/25 15:18:44 wiz Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -154,7 +154,8 @@ True if .Ar file exists and is a symbolic link. This operator is retained for compatibility with previous versions of -this program. Do not rely on its existence; use +this program. +Do not rely on its existence; use .Fl h instead. .It Fl O Ar file @@ -284,13 +285,13 @@ operator. .Sh GRAMMAR AMBIGUITY The .Nm test -grammar is inherently ambiguous. In order to assure a degree of consistency, -the cases described in +grammar is inherently ambiguous. +In order to assure a degree of consistency, the cases described in .St -p1003.2 section 4.62.4, are evaluated consistently according to the rules specified in the -standards document. All other cases are subject to the ambiguity in the -command semantics. +standards document. +All other cases are subject to the ambiguity in the command semantics. .Sh EXIT STATUS The .Nm test