diff options
author | Jason McIntyre <jmc@cvs.openbsd.org> | 2015-12-26 18:44:02 +0000 |
---|---|---|
committer | Jason McIntyre <jmc@cvs.openbsd.org> | 2015-12-26 18:44:02 +0000 |
commit | 2b912f2c038f2bea4acbdae6914cd1ae664e8457 (patch) | |
tree | 4b7b65428ebbdfb1b3eb51d816206896c8a61be2 /bin/ksh/ksh.1 | |
parent | 1184d8dc2fe2130236aefe4c423bd50de659925a (diff) |
remove special characters; diff from michael reed
Diffstat (limited to 'bin/ksh/ksh.1')
-rw-r--r-- | bin/ksh/ksh.1 | 202 |
1 files changed, 101 insertions, 101 deletions
diff --git a/bin/ksh/ksh.1 b/bin/ksh/ksh.1 index 7225b951cb0..c0c7ba5b879 100644 --- a/bin/ksh/ksh.1 +++ b/bin/ksh/ksh.1 @@ -1,8 +1,8 @@ -.\" $OpenBSD: ksh.1,v 1.171 2015/11/24 21:07:31 mmcc Exp $ +.\" $OpenBSD: ksh.1,v 1.172 2015/12/26 18:44:01 jmc Exp $ .\" .\" Public Domain .\" -.Dd $Mdocdate: November 24 2015 $ +.Dd $Mdocdate: December 26 2015 $ .Dt KSH 1 .Os .Sh NAME @@ -14,7 +14,7 @@ .Bk -words .Op Fl +abCefhiklmnpruvXx .Op Fl +o Ar option -.Op Fl c Ar string \*(Ba Fl s \*(Ba Ar file Op Ar argument ... +.Op Fl c Ar string | Fl s | Ar file Op Ar argument ... .Ek .Sh DESCRIPTION .Nm @@ -124,10 +124,10 @@ option of the built-in command can't be used. .It Redirections that create files can't be used (i.e.\& -.Ql \*(Gt , -.Ql \*(Gt\*(Ba , -.Ql \*(Gt\*(Gt , -.Ql \*(Lt\*(Gt ) . +.Ql > , +.Ql >| , +.Ql >> , +.Ql <> ) . .El .It Fl s The shell reads commands from standard input; all non-option arguments @@ -206,9 +206,9 @@ The shell begins parsing its input by breaking it into Words, which are sequences of characters, are delimited by unquoted whitespace characters (space, tab, and newline) or meta-characters .Po -.Ql \*(Lt , -.Ql \*(Gt , -.Ql \*(Ba , +.Ql < , +.Ql > , +.Ql | , .Ql \&; , .Ql \&( , .Ql \&) , @@ -219,18 +219,18 @@ Aside from delimiting words, spaces and tabs are ignored, while newlines usually delimit commands. The meta-characters are used in building the following .Em tokens : -.Ql \*(Lt , -.Ql \*(Lt& , -.Ql \*(Lt\*(Lt , -.Ql \*(Gt , -.Ql \*(Gt& , -.Ql \*(Gt\*(Gt , +.Ql < , +.Ql <& , +.Ql << , +.Ql > , +.Ql >& , +.Ql >> , etc. are used to specify redirections (see .Sx Input/output redirection below); -.Ql \*(Ba +.Ql | is used to create pipelines; -.Ql \*(Ba& +.Ql |& is used to create co-processes (see .Sx Co-processes below); @@ -474,7 +474,7 @@ a (syntactically correct) reserved word. For example, the following are all valid: .Bd -literal -offset indent $ { echo foo; echo bar; } -$ { echo foo; echo bar\*(Ltnewline\*(Gt } +$ { echo foo; echo bar<newline> } $ { { echo foo; echo bar; } } .Ed .Pp @@ -751,9 +751,9 @@ expressions are patterns (e.g. the comparison succeeds). .It There are two additional binary operators, -.Ql \*(Lt +.Ql < and -.Ql \*(Gt , +.Ql > , which return true if their first string operand is less than, or greater than, their second string operand, respectively. .It @@ -772,12 +772,12 @@ and .Ql || operators. This means that in the following statement, -.Ic $(\*(Lt foo) +.Ic $(< foo) is evaluated if and only if the file .Pa foo exists and is readable: .Bd -literal -offset indent -$ [[ -r foo && $(\*(Lt foo) = b*r ]] +$ [[ -r foo && $(< foo) = b*r ]] .Ed .El .El @@ -943,9 +943,9 @@ whitespace does create an empty field. Example: If .Ev IFS is set to -.Dq \*(Ltspace\*(Gt: , +.Dq <space>: , and VAR is set to -.Dq \*(Ltspace\*(GtA\*(Ltspace\*(Gt:\*(Ltspace\*(Gt\*(Ltspace\*(GtB::D , +.Dq <space>A<space>:<space><space>B::D , the substitution for $VAR results in four fields: .Sq A , .Sq B , @@ -1008,7 +1008,7 @@ As a special case in command substitutions, a command of the form is interpreted to mean substitute the contents of .Ar file . Note that -.Ic $(\*(Lt foo) +.Ic $(< foo) has the same effect as .Ic $(cat foo) , but it is carried out more efficiently because no process is started. @@ -1676,11 +1676,11 @@ in reverse video, in the prompt string: .Bd -literal -offset indent x=$(print \e\e001) -PS1="$x$(print \e\er)$x$(tput so)$x\e$PWD$x$(tput se)$x\*(Gt " +PS1="$x$(print \e\er)$x$(tput so)$x\e$PWD$x$(tput se)$x> " .Ed .It Ev PS2 Secondary prompt string, by default -.Sq \*(Gt\ \& , +.Sq >\ \& , used when more input is needed to complete a command. .It Ev PS3 Prompt used by the @@ -1903,7 +1903,7 @@ A character class may not be used as an endpoint of a range. Like [..], except it matches any character not inside the brackets. .Sm off -.It *( Ar pattern\*(Ba No ...\*(Ba Ar pattern ) +.It *( Ar pattern Ns | No ...| Ar pattern ) .Sm on Matches any string of characters that matches zero or more occurrences of the specified patterns. @@ -1916,7 +1916,7 @@ matches the strings .Dq foobarfoo , etc. .Sm off -.It +( Ar pattern\*(Ba No ...\*(Ba Ar pattern ) +.It +( Ar pattern Ns | No ...| Ar pattern ) .Sm on Matches any string of characters that matches one or more occurrences of the specified patterns. @@ -1928,7 +1928,7 @@ matches the strings .Dq foobar , etc. .Sm off -.It ?( Ar pattern\*(Ba No ...\*(Ba Ar pattern ) +.It ?( Ar pattern Ns | No ...| Ar pattern ) .Sm on Matches the empty string or a string that matches one of the specified patterns. @@ -1940,7 +1940,7 @@ only matches the strings and .Dq bar . .Sm off -.It @( Ar pattern\*(Ba No ...\*(Ba Ar pattern ) +.It @( Ar pattern Ns | No ...| Ar pattern ) .Sm on Matches a string that matches one of the specified patterns. Example: The pattern @@ -1950,7 +1950,7 @@ only matches the strings and .Dq bar . .Sm off -.It !( Ar pattern\*(Ba No ...\*(Ba Ar pattern ) +.It !( Ar pattern Ns | No ...| Ar pattern ) .Sm on Matches any string that does not match one of the specified patterns. Examples: The pattern @@ -2000,7 +2000,7 @@ input is initially set to be from .Pa /dev/null , and commands for which any of the following redirections have been specified: .Bl -tag -width Ds -.It \*(Gt Ar file +.It > Ar file Standard output is redirected to .Ar file . If @@ -2009,37 +2009,37 @@ does not exist, it is created; if it does exist, is a regular file, and the .Ic noclobber option is set, an error occurs; otherwise, the file is truncated. Note that this means the command -.Ic cmd \*(Lt foo \*(Gt foo +.Ic cmd < foo > foo will open .Ar foo for reading and then truncate it when it opens it for writing, before .Ar cmd gets a chance to actually read .Ar foo . -.It \*(Gt\*(Ba Ar file +.It >| Ar file Same as -.Ic \*(Gt , +.Ic > , except the file is truncated, even if the .Ic noclobber option is set. -.It \*(Gt\*(Gt Ar file +.It >> Ar file Same as -.Ic \*(Gt , +.Ic > , except if .Ar file exists it is appended to instead of being truncated. Also, the file is opened in append mode, so writes always go to the end of the file (see .Xr open 2 ) . -.It \*(Lt Ar file +.It < Ar file Standard input is redirected from .Ar file , which is opened for reading. -.It \*(Lt\*(Gt Ar file +.It <> Ar file Same as -.Ic \*(Lt , +.Ic < , except the file is opened for reading and writing. -.It \*(Lt\*(Lt Ar marker +.It << Ar marker After reading the command line containing this kind of redirection (called a .Dq here document ) , the shell copies lines from the command source into a temporary file until a @@ -2063,11 +2063,11 @@ and .Ql \enewline . If multiple here documents are used on the same command line, they are saved in order. -.It \*(Lt\*(Lt- Ar marker +.It <<- Ar marker Same as -.Ic \*(Lt\*(Lt , +.Ic << , except leading tabs are stripped from lines in the here document. -.It \*(Lt& Ar fd +.It <& Ar fd Standard input is duplicated from file descriptor .Ar fd . .Ar fd @@ -2078,9 +2078,9 @@ indicating the file descriptor associated with the output of the current co-process; or the character .Ql - , indicating standard input is to be closed. -.It \*(Gt& Ar fd +.It >& Ar fd Same as -.Ic \*(Lt& , +.Ic <& , except the operation is done on standard output. .El .Pp @@ -2113,7 +2113,7 @@ Redirections are processed after pipelines are created and in the order they are given, so the following will print an error with a line number prepended to it: .Pp -.D1 $ cat /foo/bar 2\*(Gt&1 \*(Gt /dev/null \*(Ba cat -n +.D1 $ cat /foo/bar 2>&1 > /dev/null | cat -n .Ss Arithmetic expressions Integer arithmetic expressions can be used with the .Ic let @@ -2135,15 +2135,15 @@ Unary operators: Binary operators: .Bd -literal -offset indent , -= *= /= %= += -= \*(Lt\*(Lt= \*(Gt\*(Gt= &= ^= \*(Ba= -\*(Ba\*(Ba += *= /= %= += -= <<= >>= &= ^= |= +|| && -\*(Ba +| ^ & == != -\*(Lt \*(Lt= \*(Gt= \*(Gt -\*(Lt\*(Lt \*(Gt\*(Gt +< <= >= > +<< >> + - * / % .Ed @@ -2208,8 +2208,8 @@ The result is the value of the expression on the right-hand side. .It = Assignment; the variable on the left is set to the value on the right. .It Xo -.No *= /= += -= \*(Lt\*(Lt= -.No \*(Gt\*(Gt= &= ^= \*(Ba= +.No *= /= += -= <<= +.No >>= &= ^= |= .Xc Assignment operators. .Sm off @@ -2233,7 +2233,7 @@ For example, .Dq var1 *= 5 + 3 is the same as specifying .Dq var1 = var1 * (5 + 3) . -.It \*(Ba\*(Ba +.It || Logical OR; the result is 1 if either argument is non-zero, 0 if not. The right argument is evaluated only if the left argument is zero. @@ -2241,7 +2241,7 @@ The right argument is evaluated only if the left argument is zero. Logical AND; the result is 1 if both arguments are non-zero, 0 if not. The right argument is evaluated only if the left argument is non-zero. -.It \*(Ba +.It | Arithmetic (bit-wise) OR. .It ^ Arithmetic (bit-wise) XOR @@ -2252,14 +2252,14 @@ Arithmetic (bit-wise) AND. Equal; the result is 1 if both arguments are equal, 0 if not. .It != Not equal; the result is 0 if both arguments are equal, 1 if not. -.It \*(Lt +.It < Less than; the result is 1 if the left argument is less than the right, 0 if not. -.It \*(Lt= \*(Gt= \*(Gt +.It <= >= > Less than or equal, greater than or equal, greater than. See -.Ic \*(Lt . -.It \*(Lt\*(Lt \*(Gt\*(Gt +.Ic < . +.It << >> Shift left (right); the result is the left argument with its bits shifted left (right) by the amount given in the right argument. .It + - * / @@ -2284,25 +2284,25 @@ otherwise the result is .El .Ss Co-processes A co-process, which is a pipeline created with the -.Sq \*(Ba& +.Sq |& operator, is an asynchronous process that the shell can both write to (using .Ic print -p ) and read from (using .Ic read -p ) . The input and output of the co-process can also be manipulated using -.Ic \*(Gt&p +.Ic >&p and -.Ic \*(Lt&p +.Ic <&p redirections, respectively. Once a co-process has been started, another can't be started until the co-process exits, or until the co-process's input has been redirected using an -.Ic exec Ar n Ns Ic \*(Gt&p +.Ic exec Ar n Ns Ic >&p redirection. If a co-process's input is redirected in this way, the next co-process to be started will share the output with the first co-process, unless the output of the initial co-process has been redirected using an -.Ic exec Ar n Ns Ic \*(Lt&p +.Ic exec Ar n Ns Ic <&p redirection. .Pp Some notes concerning co-processes: @@ -2311,7 +2311,7 @@ Some notes concerning co-processes: The only way to close the co-process's input (so the co-process reads an end-of-file) is to redirect the input to a numbered file descriptor and then close that file descriptor e.g.\& -.Ic exec 3\*(Gt&p; exec 3\*(Gt&- . +.Ic exec 3>&p; exec 3>&- . .It In order for co-processes to share a common output, the shell must keep the write portion of the output pipe open. @@ -2756,7 +2756,7 @@ The null command. Exit status is set to zero. .Pp .It Xo Ic alias -.Oo Fl d \*(Ba t Oo Fl r Oc \*(Ba +.Oo Fl d | t Oo Fl r Oc | .Cm +-x Oc .Op Fl p .Op Cm + @@ -3102,7 +3102,7 @@ A command that exits with a non-zero status. .It Xo .Ic fc .Oo -.Fl e Ar editor \*(Ba +.Fl e Ar editor | .Fl l Op Fl n .Oc .Op Fl r @@ -3286,10 +3286,10 @@ and the displayed job. .Pp .It Xo .Ic kill -.Oo Fl s Ar signame \*(Ba -.No - Ns Ar signum \*(Ba +.Oo Fl s Ar signame | +.No - Ns Ar signum | .No - Ns Ar signame Oc -.No { Ar job \*(Ba pid \*(Ba pgrp No } +.No { Ar job | pid | pgrp No } .Ar ... .Xc Send the specified signal to the specified jobs, process IDs, or process @@ -3330,7 +3330,7 @@ is syntactic sugar for .Ic mknod .Op Fl m Ar mode .Ar name -.Cm b\*(Bac +.Cm b Ns Pf | Cm c .Ar major minor .Xc .It Xo @@ -3366,7 +3366,7 @@ for further information. .It Xo .Ic print .Oo -.Fl nprsu Ns Oo Ar n Oc \*(Ba +.Fl nprsu Ns Oo Ar n Oc | .Fl R Op Fl en .Oc .Op Ar argument ... @@ -3576,17 +3576,17 @@ is used, the array is reset (i.e. emptied) first; if .Ic +A is used, the first N elements are set (where N is the number of arguments); the rest are left untouched. -.It Fl a \*(Ba Ic allexport +.It Fl a | Ic allexport All new parameters are created with the export attribute. -.It Fl b \*(Ba Ic notify +.It Fl b | Ic notify Print job notification messages asynchronously, instead of just before the prompt. Only used if job control is enabled .Pq Fl m . -.It Fl C \*(Ba Ic noclobber -Prevent \*(Gt redirection from overwriting existing files. -Instead, \*(Gt\*(Ba must be used to force an overwrite. -.It Fl e \*(Ba Ic errexit +.It Fl C | Ic noclobber +Prevent > redirection from overwriting existing files. +Instead, >| must be used to force an overwrite. +.It Fl e | Ic errexit Exit (after executing the .Dv ERR trap) as soon as an error occurs or a command fails (i.e. exits with a @@ -3604,28 +3604,28 @@ For or .Ic || , only the status of the last command is tested. -.It Fl f \*(Ba Ic noglob +.It Fl f | Ic noglob Do not expand file name patterns. -.It Fl h \*(Ba Ic trackall +.It Fl h | Ic trackall Create tracked aliases for all executed commands (see .Sx Aliases above). Enabled by default for non-interactive shells. -.It Fl k \*(Ba Ic keyword +.It Fl k | Ic keyword Parameter assignments are recognized anywhere in a command. -.It Fl m \*(Ba Ic monitor +.It Fl m | Ic monitor Enable job control (default for interactive shells). -.It Fl n \*(Ba Ic noexec +.It Fl n | Ic noexec Do not execute any commands. Useful for checking the syntax of scripts (ignored if interactive). -.It Fl p \*(Ba Ic privileged +.It Fl p | Ic privileged The shell is a privileged shell. It is set automatically if, when the shell starts, the real UID or GID does not match the effective UID (EUID) or GID (EGID), respectively. See above for a description of what this means. -.It Fl s \*(Ba Ic stdin +.It Fl s | Ic stdin If used when the shell is invoked, commands are read from standard input. Set automatically if the shell is invoked with no arguments. .Pp @@ -3639,20 +3639,20 @@ the positional parameters (or to array if .Fl A is used). -.It Fl u \*(Ba Ic nounset +.It Fl u | Ic nounset Referencing of an unset parameter is treated as an error, unless one of the .Ql - , .Ql + , or .Ql = modifiers is used. -.It Fl v \*(Ba Ic verbose +.It Fl v | Ic verbose Write shell input to standard error as it is read. -.It Fl X \*(Ba Ic markdirs +.It Fl X | Ic markdirs Mark directories with a trailing .Ql / during file name generation. -.It Fl x \*(Ba Ic xtrace +.It Fl x | Ic xtrace Print commands and parameter assignments when they are executed, preceded by the value of .Ev PS4 . @@ -4065,8 +4065,8 @@ Simple redirections of standard error do not affect the output of the .Ic time command: .Pp -.Dl $ time sleep 1 2\*(Gt afile -.Dl $ { time sleep 1; } 2\*(Gt afile +.Dl $ time sleep 1 2> afile +.Dl $ { time sleep 1; } 2> afile .Pp Times for the first command do not go to .Dq afile , @@ -4544,7 +4544,7 @@ sign .Pq Sq % . Other percent sequences can also be used to refer to jobs: .Bl -tag -width "%+ | %% | %XX" -.It %+ \*(Ba %% \*(Ba % +.It %+ | %% | % The most recently stopped job or, if there are no stopped jobs, the oldest running job. .It %- @@ -4667,10 +4667,10 @@ In these editing modes, if a line is longer than the screen width (see the .Ev COLUMNS parameter), a -.Ql \*(Gt , +.Ql > , .Ql + , or -.Ql \*(Lt +.Ql < character is displayed in the last column indicating that there are more characters after, before and after, or before the current position, respectively. @@ -4745,7 +4745,7 @@ alphanumerics, underscore and dollar sign .Pq Sq $ characters. -.It beginning-of-history: ^[\*(Lt +.It beginning-of-history: ^[< Moves to the beginning of the history. .It beginning-of-line: ^A Moves the cursor to the beginning of the edited input line. @@ -4839,7 +4839,7 @@ has been performed. Lowercases the next .Ar n words. -.It end-of-history: ^[\*(Gt +.It end-of-history: ^[> Moves to the end of the history. .It end-of-line: ^E Moves the cursor to the end of the input line. @@ -5078,7 +5078,7 @@ list of possible completions is displayed; if used a third time, the completion is undone. .It ^H Erases previous character. -.It ^J \*(Ba ^M +.It ^J | ^M End of line. The current line is read, parsed, and executed by the shell. .It ^V @@ -5243,7 +5243,7 @@ Move to column 0. .It ^ Move to the first non-whitespace character. .It Xo -.Oo Ar n Oc Ns \*(Ba +.Oo Ar n Oc Ns | .Xc Move to column .Ar n . |