From owner-svn-src-head@FreeBSD.ORG Sun Apr 4 13:17:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEB46106566B; Sun, 4 Apr 2010 13:17:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD66E8FC14; Sun, 4 Apr 2010 13:17:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o34DH5Ik021200; Sun, 4 Apr 2010 13:17:05 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o34DH5hD021198; Sun, 4 Apr 2010 13:17:05 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004041317.o34DH5hD021198@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 4 Apr 2010 13:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206158 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Apr 2010 13:17:06 -0000 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.