This commit is contained in:
tg
2016-01-20 22:04:54 +00:00
parent 61f7661b92
commit 91ae6ad199

34
mksh.1
View File

@ -1,4 +1,4 @@
.\" $MirOS: src/bin/mksh/mksh.1,v 1.387 2016/01/14 23:18:09 tg Exp $ .\" $MirOS: src/bin/mksh/mksh.1,v 1.388 2016/01/20 22:04:54 tg Exp $
.\" $OpenBSD: ksh.1,v 1.160 2015/07/04 13:27:04 feinerer Exp $ .\" $OpenBSD: ksh.1,v 1.160 2015/07/04 13:27:04 feinerer Exp $
.\"- .\"-
.\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
@ -74,7 +74,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: January 14 2016 $ .Dd $Mdocdate: January 20 2016 $
.\" .\"
.\" Check which macro package we use, and do other -mdoc setup. .\" Check which macro package we use, and do other -mdoc setup.
.\" .\"
@ -439,7 +439,7 @@ Whitespace and meta-characters can be quoted individually using a backslash
or in groups using double or in groups using double
.Pq Sq \&" .Pq Sq \&"
or single or single
.Pq Sq \*(aq .Pq Dq \*(aq
quotes. quotes.
Note that the following characters are also treated specially by the Note that the following characters are also treated specially by the
shell and must be quoted if they are to represent themselves: shell and must be quoted if they are to represent themselves:
@ -993,7 +993,7 @@ case both the
.Ql \e .Ql \e
and the newline are stripped. and the newline are stripped.
Second, a single quote Second, a single quote
.Pq Sq \*(aq .Pq Dq \*(aq
quotes everything up to the next single quote (this may span lines). quotes everything up to the next single quote (this may span lines).
Third, a double quote Third, a double quote
.Pq Sq \&" .Pq Sq \&"
@ -1006,8 +1006,8 @@ up to the next unquoted double quote.
.Ql $ .Ql $
and and
.Ql \` .Ql \`
inside double quotes have their usual meaning (i.e. parameter, command, or inside double quotes have their usual meaning (i.e. parameter, arithmetic,
arithmetic substitution) except no field splitting is carried out on the or command substitution) except no field splitting is carried out on the
results of double-quoted substitutions. results of double-quoted substitutions.
If a If a
.Ql \e .Ql \e
@ -1031,7 +1031,9 @@ characters inside can be escaped and do not terminate the string then);
the expanded result is treated as any other single-quoted string. the expanded result is treated as any other single-quoted string.
If a double-quoted string is preceded by an unquoted If a double-quoted string is preceded by an unquoted
.Ql $ , .Ql $ ,
the latter is ignored. the
.Ql $
is simply ignored.
.Ss Backslash expansion .Ss Backslash expansion
In places where backslashes are expanded, certain C and In places where backslashes are expanded, certain C and
.At .At
@ -1291,6 +1293,8 @@ command which is run in a subshell.
For For
.Pf $( Ns Ar command Ns \&) .Pf $( Ns Ar command Ns \&)
and and
.Pf ${\*(Ba\& Ns Ar command Ns \&;}
and
.Pf ${\ \& Ar command Ns \&;} .Pf ${\ \& Ar command Ns \&;}
substitutions, normal quoting rules are used when substitutions, normal quoting rules are used when
.Ar command .Ar command
@ -1301,6 +1305,8 @@ form, a
followed by any of followed by any of
.Ql $ , .Ql $ ,
.Ql \` , .Ql \` ,
.Ql \&"
.Pq currently, and violating Tn POSIX ,
or or
.Ql \e .Ql \e
is stripped (a is stripped (a
@ -6588,8 +6594,20 @@ when multiple shells are accessing the file; the rollover process
for the in-memory portion of the history is slow, should use for the in-memory portion of the history is slow, should use
.Xr memmove 3 . .Xr memmove 3 .
.Pp .Pp
Handling of backslash plus double-quote inside the (deprecated)
.Pf \` Ns Ar command Ns \`
form of command substitution when the substitution itself is
also inside double quotes currently deliberately violates
.Tn POSIX
even in
.Fl o Ic posix
mode until Austin group bug 1015 has been resolved either way,
as the current wording of the standard prohibits the current
and historic practice of several shells which several scripts
(admittedly wrongly) depend on.
.Pp
This document attempts to describe This document attempts to describe
.Nm mksh\ R52 .Nm mksh\ R52b
and up, and up,
.\" with vendor patches from insert-your-name-here, .\" with vendor patches from insert-your-name-here,
compiled without any options impacting functionality, such as compiled without any options impacting functionality, such as