svn commit: r223711 - stable/8/bin/sh
Jilles Tjoelker
jilles at FreeBSD.org
Fri Jul 1 12:30:35 UTC 2011
Author: jilles
Date: Fri Jul 1 12:30:34 2011
New Revision: 223711
URL: http://svn.freebsd.org/changeset/base/223711
Log:
MFC r223522: sh(1): Improve documentation of shell patterns:
* Shell patterns are also for ${var#pat} and the like.
* An '!' by itself will not trigger pathname generation so do not call it a
meta-character, even though it has a special meaning directly after an
'['.
* Character ranges are locale-dependent.
* A '^' will complement a character class like '!' but is non-standard.
Modified:
stable/8/bin/sh/sh.1
Directory Properties:
stable/8/bin/sh/ (props changed)
Modified: stable/8/bin/sh/sh.1
==============================================================================
--- stable/8/bin/sh/sh.1 Fri Jul 1 12:13:48 2011 (r223710)
+++ stable/8/bin/sh/sh.1 Fri Jul 1 12:30:34 2011 (r223711)
@@ -32,7 +32,7 @@
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
-.Dd December 3, 2010
+.Dd June 24, 2011
.Dt SH 1
.Os
.Sh NAME
@@ -1521,15 +1521,15 @@ There are two restrictions on this: firs
a string containing a slash, and second,
a pattern cannot match a string starting with a period
unless the first character of the pattern is a period.
-The next section describes the patterns used for both
-Pathname Expansion and the
+The next section describes the patterns used for
+Pathname Expansion,
+the four varieties of parameter expansion for substring processing and the
.Ic case
command.
.Ss Shell Patterns
A pattern consists of normal characters, which match themselves,
and meta-characters.
The meta-characters are
-.Ql \&! ,
.Ql * ,
.Ql \&? ,
and
@@ -1559,16 +1559,21 @@ matches a
.Ql \&[
rather than introducing a character class.
A character class matches any of the characters between the square brackets.
-A range of characters may be specified using a minus sign.
+A locale-dependent range of characters may be specified using a minus sign.
The character class may be complemented by making an exclamation point
.Pq Ql !\&
the first character of the character class.
+A caret
+.Pq Ql ^
+has the same effect but is non-standard.
.Pp
To include a
.Ql \&]
in a character class, make it the first character listed
(after the
-.Ql \&! ,
+.Ql \&!
+or
+.Ql ^ ,
if any).
To include a
.Ql - ,
More information about the svn-src-all
mailing list