svn commit: r206158 - head/bin/sh
Jilles Tjoelker
jilles at FreeBSD.org
Sun Apr 4 13:17:06 UTC 2010
Author: jilles
Date: Sun Apr 4 13:17:05 2010
New Revision: 206158
URL: http://svn.freebsd.org/changeset/base/206158
Log:
sh: Document the expansion changes in the man page.
Note that the following sentence
> Enclosing the full parameter expansion string in double-quotes does not
> cause the following four varieties of pattern characters to be quoted,
> whereas quoting characters within the braces has this effect.
is now true, but used to be incorrect.
Modified:
head/bin/sh/sh.1
Modified: head/bin/sh/sh.1
==============================================================================
--- head/bin/sh/sh.1 Sun Apr 4 08:47:34 2010 (r206157)
+++ head/bin/sh/sh.1 Sun Apr 4 13:17:05 2010 (r206158)
@@ -32,7 +32,7 @@
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
-.Dd March 6, 2010
+.Dd April 4, 2010
.Dt SH 1
.Os
.Sh NAME
@@ -1178,10 +1178,20 @@ consists of all characters until the mat
.Ql } .
Any
.Ql }
-escaped by a backslash or within a quoted string, and characters in
+escaped by a backslash or within a single-quoted string, and characters in
embedded arithmetic expansions, command substitutions, and variable
expansions, are not examined in determining the matching
.Ql } .
+Except for the variants with
+.Ql + ,
+.Ql - ,
+.Ql =
+or
+.Ql ?\& ,
+any
+.Ql }
+within a double-quoted string is also not examined in determining the matching
+.Ql } .
.Pp
The simplest form for parameter expansion is:
.Pp
@@ -1265,6 +1275,14 @@ is substituted.
In the parameter expansions shown previously, use of the colon in the
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.
+.Pp
+The
+.Ar word
+inherits the type of quoting
+(unquoted, double-quoted or here-document)
+from the surroundings,
+with the exception that a backslash that quotes a closing brace is removed
+during quote removal.
.Bl -tag -width indent
.It Li ${# Ns Ar parameter Ns Li }
String Length.
More information about the svn-src-all
mailing list