diff options
author | jilles <jilles@FreeBSD.org> | 2011-06-15 21:48:10 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2011-06-15 21:48:10 +0000 |
commit | 84b55be725c7dfa96339786e79ce1935e17f7165 (patch) | |
tree | 96218b02aec3161b99056c7f828d160ff6dfb2f9 /bin/sh/sh.1 | |
parent | caf476d4f9b966954fb606d0154f75e875ceadfa (diff) | |
download | FreeBSD-src-84b55be725c7dfa96339786e79ce1935e17f7165.zip FreeBSD-src-84b55be725c7dfa96339786e79ce1935e17f7165.tar.gz |
sh: Add support for named character classes in bracket expressions.
Example:
case x in [[:alpha:]]) echo yes ;; esac
Diffstat (limited to 'bin/sh/sh.1')
-rw-r--r-- | bin/sh/sh.1 | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index 3b7f3d3..67ffcc6 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 June 12, 2011 +.Dd June 15, 2011 .Dt SH 1 .Os .Sh NAME @@ -1648,6 +1648,15 @@ matches a 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 named class of characters (see +.Xr wctype 3 ) +may be specified by surrounding the name with +.Ql \&[: +and +.Ql :\&] . +For example, +.Ql \&[\&[:alpha:\&]\&] +is a shell pattern that matches a single letter. The character class may be complemented by making an exclamation point .Pq Ql !\& the first character of the character class. @@ -2572,6 +2581,7 @@ will return the argument. .Xr execve 2 , .Xr getrlimit 2 , .Xr umask 2 , +.Xr wctype 3 , .Xr editrc 5 .Sh HISTORY A |