From 91ae6ad199035b1cfa2589592cbca1570b4c1c4f Mon Sep 17 00:00:00 2001 From: tg Date: Wed, 20 Jan 2016 22:04:54 +0000 Subject: [PATCH] update --- mksh.1 | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/mksh.1 b/mksh.1 index 4e056e4..923c721 100644 --- a/mksh.1 +++ b/mksh.1 @@ -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 $ .\"- .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, @@ -74,7 +74,7 @@ .\" with -mandoc, it might implement .Mx itself, but we want to .\" 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. .\" @@ -439,7 +439,7 @@ Whitespace and meta-characters can be quoted individually using a backslash or in groups using double .Pq Sq \&" or single -.Pq Sq \*(aq +.Pq Dq \*(aq quotes. Note that the following characters are also treated specially by the shell and must be quoted if they are to represent themselves: @@ -993,7 +993,7 @@ case both the .Ql \e and the newline are stripped. Second, a single quote -.Pq Sq \*(aq +.Pq Dq \*(aq quotes everything up to the next single quote (this may span lines). Third, a double quote .Pq Sq \&" @@ -1006,8 +1006,8 @@ up to the next unquoted double quote. .Ql $ and .Ql \` -inside double quotes have their usual meaning (i.e. parameter, command, or -arithmetic substitution) except no field splitting is carried out on the +inside double quotes have their usual meaning (i.e. parameter, arithmetic, +or command substitution) except no field splitting is carried out on the results of double-quoted substitutions. If a .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. If a double-quoted string is preceded by an unquoted .Ql $ , -the latter is ignored. +the +.Ql $ +is simply ignored. .Ss Backslash expansion In places where backslashes are expanded, certain C and .At @@ -1291,6 +1293,8 @@ command which is run in a subshell. For .Pf $( Ns Ar command Ns \&) and +.Pf ${\*(Ba\& Ns Ar command Ns \&;} +and .Pf ${\ \& Ar command Ns \&;} substitutions, normal quoting rules are used when .Ar command @@ -1301,6 +1305,8 @@ form, a followed by any of .Ql $ , .Ql \` , +.Ql \&" +.Pq currently, and violating Tn POSIX , or .Ql \e 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 .Xr memmove 3 . .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 -.Nm mksh\ R52 +.Nm mksh\ R52b and up, .\" with vendor patches from insert-your-name-here, compiled without any options impacting functionality, such as