summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2010-04-04 13:17:05 +0000
committerjilles <jilles@FreeBSD.org>2010-04-04 13:17:05 +0000
commitf4618de0613ad4776cda13039f643c70cbb26f7c (patch)
tree64c673685102af6318d3491e0cac9e1735bcc74a
parent86fb8e4f3fda90b91747e919033547769a68982f (diff)
downloadFreeBSD-src-f4618de0613ad4776cda13039f643c70cbb26f7c.zip
FreeBSD-src-f4618de0613ad4776cda13039f643c70cbb26f7c.tar.gz
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.
-rw-r--r--bin/sh/sh.122
1 files changed, 20 insertions, 2 deletions
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1
index 4df5212..e577c66 100644
--- a/bin/sh/sh.1
+++ b/bin/sh/sh.1
@@ -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 matching
.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.
OpenPOWER on IntegriCloud