sync with oksh and remove some unnecessary/legacy portability notes
Revision 1.136: [7]download - view: [8]text, [9]markup, [10]annotated - [11]select for diffs Thu Jul 15 20:04:35 2010 UTC (47 hours, 56 minutes ago) by schwarze Branches: [12]MAIN CVS tags: [13]HEAD Diff to: previous 1.135: [14]preferred, [15]coloured Changes since revision 1.135: +7 -7 lines When the first argument or arguments of a macro are opening delimiters (parentheses and/or square brackets), both modern groff and mandoc first output those leading delimiters as plain text, then start the macro scope after these opening delimiters. This is similar to printing trailing punctuation and trailing closing delimiters on a macro line outside and after the macro scope. For example, ".Sq ( text )" is "(`text')", not "`(text)'". Thus, we now need to quote leading opening delimiters when we want them inside the macro scope. These are the cases in src/bin. "makes sense" jmc@
This commit is contained in:
parent
6b006202a1
commit
1e113b416b
58
mksh.1
58
mksh.1
@ -1,5 +1,5 @@
|
|||||||
.\" $MirOS: src/bin/mksh/mksh.1,v 1.230 2010/07/13 13:12:30 tg Exp $
|
.\" $MirOS: src/bin/mksh/mksh.1,v 1.231 2010/07/17 20:21:18 tg Exp $
|
||||||
.\" $OpenBSD: ksh.1,v 1.135 2010/07/12 16:26:45 jmc Exp $
|
.\" $OpenBSD: ksh.1,v 1.136 2010/07/15 20:04:35 schwarze Exp $
|
||||||
.\"-
|
.\"-
|
||||||
.\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
|
.\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
|
||||||
.\" Thorsten Glaser <tg@mirbsd.org>
|
.\" Thorsten Glaser <tg@mirbsd.org>
|
||||||
@ -71,7 +71,7 @@
|
|||||||
.\" with -mandoc, it might implement .Mx itself, but we want to
|
.\" with -mandoc, it might implement .Mx itself, but we want to
|
||||||
.\" use our own definition. And .Dd must come *first*, always.
|
.\" use our own definition. And .Dd must come *first*, always.
|
||||||
.\"
|
.\"
|
||||||
.Dd $Mdocdate: July 13 2010 $
|
.Dd $Mdocdate: July 17 2010 $
|
||||||
.\"
|
.\"
|
||||||
.\" Check which macro package we use
|
.\" Check which macro package we use
|
||||||
.\"
|
.\"
|
||||||
@ -386,7 +386,7 @@ are used to specify conditional execution;
|
|||||||
is used in
|
is used in
|
||||||
.Ic case
|
.Ic case
|
||||||
statements;
|
statements;
|
||||||
.Ql (( .. ))
|
.Ql \&(( .. ))
|
||||||
is used in arithmetic expressions;
|
is used in arithmetic expressions;
|
||||||
and lastly,
|
and lastly,
|
||||||
.Ql \&( .. )\&
|
.Ql \&( .. )\&
|
||||||
@ -641,7 +641,7 @@ and
|
|||||||
.Ql }
|
.Ql }
|
||||||
are reserved words, not meta-characters.
|
are reserved words, not meta-characters.
|
||||||
.It Xo case Ar word No in
|
.It Xo case Ar word No in
|
||||||
.Oo Op (
|
.Oo Op \&(
|
||||||
.Ar \ pattern
|
.Ar \ pattern
|
||||||
.Op \*(Ba Ar pattern
|
.Op \*(Ba Ar pattern
|
||||||
.No ... No )
|
.No ... No )
|
||||||
@ -833,7 +833,7 @@ below).
|
|||||||
Note that redirections specified after a function definition are
|
Note that redirections specified after a function definition are
|
||||||
performed whenever the function is executed, not when the function definition
|
performed whenever the function is executed, not when the function definition
|
||||||
is executed.
|
is executed.
|
||||||
.It Ar name Ns () Ar command
|
.It Ar name Ns \&() Ar command
|
||||||
Mostly the same as
|
Mostly the same as
|
||||||
.Ic function
|
.Ic function
|
||||||
(see
|
(see
|
||||||
@ -842,11 +842,11 @@ below).
|
|||||||
Whitespace (space or tab) after
|
Whitespace (space or tab) after
|
||||||
.Ar name
|
.Ar name
|
||||||
will be ignored most of the time.
|
will be ignored most of the time.
|
||||||
.It Xo function Ar name Ns ()
|
.It Xo function Ar name Ns \&()
|
||||||
.No { Ar list ; No }
|
.No { Ar list ; No }
|
||||||
.Xc
|
.Xc
|
||||||
The same as
|
The same as
|
||||||
.Ar name Ns ()
|
.Ar name Ns \&()
|
||||||
.Pq Nm bash Ns ism .
|
.Pq Nm bash Ns ism .
|
||||||
The
|
The
|
||||||
.Ic function
|
.Ic function
|
||||||
@ -859,7 +859,7 @@ The
|
|||||||
reserved word is described in the
|
reserved word is described in the
|
||||||
.Sx Command execution
|
.Sx Command execution
|
||||||
section.
|
section.
|
||||||
.It (( Ar expression No ))
|
.It \&(( Ar expression No ))
|
||||||
The arithmetic expression
|
The arithmetic expression
|
||||||
.Ar expression
|
.Ar expression
|
||||||
is evaluated; equivalent to
|
is evaluated; equivalent to
|
||||||
@ -902,7 +902,7 @@ The second operand of the
|
|||||||
and
|
and
|
||||||
.Sq =
|
.Sq =
|
||||||
expressions are patterns (e.g. the comparison
|
expressions are patterns (e.g. the comparison
|
||||||
.Ic [[ foobar = f*r ]]
|
.Ic \&[[ foobar = f*r ]]
|
||||||
succeeds).
|
succeeds).
|
||||||
.It
|
.It
|
||||||
The single argument form of
|
The single argument form of
|
||||||
@ -1265,9 +1265,9 @@ form
|
|||||||
where
|
where
|
||||||
.Ar expr
|
.Ar expr
|
||||||
is an arithmetic expression.
|
is an arithmetic expression.
|
||||||
Array indices are currently limited to the range 0 through 4294967295, (for
|
Array indices are currently limited in
|
||||||
.Nm
|
.Nm
|
||||||
only; portable maximum is 1023), inclusive.
|
to the range 0 through 4294967295, inclusive.
|
||||||
That is, they are a 32-bit unsigned integer.
|
That is, they are a 32-bit unsigned integer.
|
||||||
Parameter substitutions take the form
|
Parameter substitutions take the form
|
||||||
.Pf $ Ns Ar name ,
|
.Pf $ Ns Ar name ,
|
||||||
@ -1452,8 +1452,8 @@ or not specified; otherwise the length
|
|||||||
of the string value of parameter
|
of the string value of parameter
|
||||||
.Ar name .
|
.Ar name .
|
||||||
.Pp
|
.Pp
|
||||||
.It Pf ${# Ns Ar name Ns [*]}
|
.It Pf ${# Ns Ar name Ns \&[*]}
|
||||||
.It Pf ${# Ns Ar name Ns [@]}
|
.It Pf ${# Ns Ar name Ns \&[@]}
|
||||||
The number of elements in the array
|
The number of elements in the array
|
||||||
.Ar name .
|
.Ar name .
|
||||||
.Pp
|
.Pp
|
||||||
@ -1478,8 +1478,8 @@ is a name reference (bound variable), created by the
|
|||||||
command (which is an alias for
|
command (which is an alias for
|
||||||
.Ic typeset Fl n ) .
|
.Ic typeset Fl n ) .
|
||||||
.Pp
|
.Pp
|
||||||
.It Pf ${! Ns Ar name Ns [*]}
|
.It Pf ${! Ns Ar name Ns \&[*]}
|
||||||
.It Pf ${! Ns Ar name Ns [@]}
|
.It Pf ${! Ns Ar name Ns \&[@]}
|
||||||
The names of indices (keys) in the array
|
The names of indices (keys) in the array
|
||||||
.Ar name .
|
.Ar name .
|
||||||
.Pp
|
.Pp
|
||||||
@ -2039,7 +2039,7 @@ A file name pattern is a word containing one or more unquoted
|
|||||||
or
|
or
|
||||||
.Ql \&!
|
.Ql \&!
|
||||||
characters or
|
characters or
|
||||||
.Dq [..]
|
.Dq \&[..]
|
||||||
sequences.
|
sequences.
|
||||||
Once brace expansion has been performed, the shell replaces file
|
Once brace expansion has been performed, the shell replaces file
|
||||||
name patterns with the sorted names of all the files that match the pattern
|
name patterns with the sorted names of all the files that match the pattern
|
||||||
@ -2050,12 +2050,12 @@ The pattern elements have the following meaning:
|
|||||||
Matches any single character.
|
Matches any single character.
|
||||||
.It \&*
|
.It \&*
|
||||||
Matches any sequence of octets.
|
Matches any sequence of octets.
|
||||||
.It [..]
|
.It \&[..]
|
||||||
Matches any of the octets inside the brackets.
|
Matches any of the octets inside the brackets.
|
||||||
Ranges of octets can be specified by separating two octets by a
|
Ranges of octets can be specified by separating two octets by a
|
||||||
.Ql \-
|
.Ql \-
|
||||||
(e.g.\&
|
(e.g.\&
|
||||||
.Dq [a0\-9]
|
.Dq \&[a0\-9]
|
||||||
matches the letter
|
matches the letter
|
||||||
.Sq a
|
.Sq a
|
||||||
or any digit).
|
or any digit).
|
||||||
@ -2070,7 +2070,7 @@ Also, a
|
|||||||
.Ql \&!
|
.Ql \&!
|
||||||
appearing at the start of the list has special meaning (see below), so to
|
appearing at the start of the list has special meaning (see below), so to
|
||||||
represent itself it must be quoted or appear later in the list.
|
represent itself it must be quoted or appear later in the list.
|
||||||
.It [!..]
|
.It \&[!..]
|
||||||
Like [..],
|
Like [..],
|
||||||
except it matches any octet not inside the brackets.
|
except it matches any octet not inside the brackets.
|
||||||
.Sm off
|
.Sm off
|
||||||
@ -2169,10 +2169,6 @@ If the
|
|||||||
option is set, any directories that result from file name generation are marked
|
option is set, any directories that result from file name generation are marked
|
||||||
with a trailing
|
with a trailing
|
||||||
.Ql / .
|
.Ql / .
|
||||||
.Pp
|
|
||||||
The POSIX character classes (i.e.\&
|
|
||||||
.Pf [: Ns Ar class-name Ns :]
|
|
||||||
inside a [..] expression) are not implemented.
|
|
||||||
.Ss Input/output redirection
|
.Ss Input/output redirection
|
||||||
When a command is executed, its standard input, standard output, and standard
|
When a command is executed, its standard input, standard output, and standard
|
||||||
error (file descriptors 0, 1, and 2, respectively) are normally inherited from
|
error (file descriptors 0, 1, and 2, respectively) are normally inherited from
|
||||||
@ -2615,7 +2611,7 @@ is used.
|
|||||||
Functions are defined using either Korn shell
|
Functions are defined using either Korn shell
|
||||||
.Ic function Ar function-name
|
.Ic function Ar function-name
|
||||||
syntax or the Bourne/POSIX shell
|
syntax or the Bourne/POSIX shell
|
||||||
.Ar function-name Ns ()
|
.Ar function-name Ns \&()
|
||||||
syntax (see below for the difference between the two forms).
|
syntax (see below for the difference between the two forms).
|
||||||
Functions are like
|
Functions are like
|
||||||
.Li .\(hyscripts
|
.Li .\(hyscripts
|
||||||
@ -2703,7 +2699,7 @@ Functions defined with the
|
|||||||
.Ic function
|
.Ic function
|
||||||
reserved word are treated differently in the following ways from functions
|
reserved word are treated differently in the following ways from functions
|
||||||
defined with the
|
defined with the
|
||||||
.Ic ()
|
.Ic \&()
|
||||||
notation:
|
notation:
|
||||||
.Bl -bullet
|
.Bl -bullet
|
||||||
.It
|
.It
|
||||||
@ -3417,7 +3413,7 @@ if the last expression evaluated to non-zero (zero).
|
|||||||
If an error occurs during
|
If an error occurs during
|
||||||
the parsing or evaluation of an expression, the exit status is greater than 1.
|
the parsing or evaluation of an expression, the exit status is greater than 1.
|
||||||
Since expressions may need to be quoted,
|
Since expressions may need to be quoted,
|
||||||
.No (( Ar expr No ))
|
.No \&(( Ar expr No ))
|
||||||
is syntactic sugar for
|
is syntactic sugar for
|
||||||
.No let \&" Ns Ar expr Ns \&" .
|
.No let \&" Ns Ar expr Ns \&" .
|
||||||
.Pp
|
.Pp
|
||||||
@ -4387,7 +4383,7 @@ or cleared
|
|||||||
.Pq Ic + .
|
.Pq Ic + .
|
||||||
Values for parameters may optionally be specified.
|
Values for parameters may optionally be specified.
|
||||||
For
|
For
|
||||||
.Ar name Ns [*] ,
|
.Ar name Ns \&[*] ,
|
||||||
the change affects the entire array, and no value may be specified.
|
the change affects the entire array, and no value may be specified.
|
||||||
If
|
If
|
||||||
.Ic typeset
|
.Ic typeset
|
||||||
@ -4717,7 +4713,7 @@ the default
|
|||||||
or functions
|
or functions
|
||||||
.Pq Fl f .
|
.Pq Fl f .
|
||||||
With
|
With
|
||||||
.Ar parameter Ns [*] ,
|
.Ar parameter Ns \&[*] ,
|
||||||
attributes are kept, only values are unset.
|
attributes are kept, only values are unset.
|
||||||
.Pp
|
.Pp
|
||||||
The exit status is non-zero if any of the parameters have the read-only
|
The exit status is non-zero if any of the parameters have the read-only
|
||||||
@ -4822,7 +4818,7 @@ cannot be.
|
|||||||
.Pp
|
.Pp
|
||||||
When a job is created, it is assigned a job number.
|
When a job is created, it is assigned a job number.
|
||||||
For interactive shells, this number is printed inside
|
For interactive shells, this number is printed inside
|
||||||
.Dq [..] ,
|
.Dq \&[..] ,
|
||||||
followed by the process IDs of the processes in the job when an asynchronous
|
followed by the process IDs of the processes in the job when an asynchronous
|
||||||
command is run.
|
command is run.
|
||||||
A job may be referred to in the
|
A job may be referred to in the
|
||||||
@ -6042,7 +6038,7 @@ foo \*(Ba bar \*(Ba read baz # will not change $baz
|
|||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
This document attempts to describe
|
This document attempts to describe
|
||||||
.Nm mksh\ R39d
|
.Nm mksh\ R39c+CVS
|
||||||
and up,
|
and up,
|
||||||
compiled without any options impacting functionality, such as
|
compiled without any options impacting functionality, such as
|
||||||
.Dv MKSH_SMALL ,
|
.Dv MKSH_SMALL ,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user