diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ksh/sh.1 | 70 | ||||
-rw-r--r-- | bin/ksh/sh.1tbl | 70 |
2 files changed, 138 insertions, 2 deletions
diff --git a/bin/ksh/sh.1 b/bin/ksh/sh.1 index bcd826a4251..ac5dfe893e7 100644 --- a/bin/ksh/sh.1 +++ b/bin/ksh/sh.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sh.1,v 1.28 2001/09/02 14:05:58 aaron Exp $ +.\" $OpenBSD: sh.1,v 1.29 2002/05/04 22:21:21 krw Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -1370,6 +1370,74 @@ represent itself it must be quoted or appear later in the list. Like .Ic \&[ Ns No .. Ns Ic \&] , except it matches any character not inside the brackets. +.Sm on +Matches any string of characters that matches zero or more occurrences of the +specified patterns. +Example: The pattern +.Ic \&*(foo\&|bar) +matches the strings +.Dq , +.Dq foo , +.Dq bar , +.Dq foobarfoo , +etc. +.Sm off +.It Xo Ic \&+( Ar pattern Ic \&| No \ ...\ +.Ic \&| Ar pattern Ic \&) +.Xc +.Sm on +Matches any string of characters that matches one or more occurrences of the +specified patterns. +Example: The pattern +.Ic \&+(foo\&|bar) +matches the strings +.Dq foo , +.Dq bar , +.Dq foobar , +etc. +.Sm off +.It Xo Ic \&?( Ar pattern Ic \&| No \ ...\ +.Ic \&| Ar pattern Ic \&) +.Xc +.Sm on +Matches the empty string or a string that matches one of the specified +patterns. +Example: The pattern +.Ic \&?(foo\&|bar) +only matches the strings +.Dq , +.Dq foo +and +.Dq bar . +.Sm off +.It Xo Ic \&@( Ar pattern Ic \&| No \ ...\ +.Ic \&| Ar pattern Ic \&) +.Xc +.Sm on +Matches a string that matches one of the specified patterns. +Example: The pattern +.Ic \&@(foo\&|bar) +only matches the strings +.Dq foo +and +.Dq bar . +.Sm off +.It Xo Ic \&!( Ar pattern Ic \&| No \ ...\ +.Ic \&| Ar pattern Ic \&) +.Xc +.Sm on +Matches any string that does not match one of the specified patterns. +Examples: The pattern +.Ic \&!(foo\&|bar) +matches all strings except +.Dq foo +and +.Dq bar ; +the pattern +.Ic \&!(\&*) +matches no strings; the pattern +.Ic \&!(\&?)\&* +matches all strings (think about it). .El .Pp Note that diff --git a/bin/ksh/sh.1tbl b/bin/ksh/sh.1tbl index 2b3d5d56a3f..e50e0da89cb 100644 --- a/bin/ksh/sh.1tbl +++ b/bin/ksh/sh.1tbl @@ -1,4 +1,4 @@ -.\" $OpenBSD: sh.1tbl,v 1.28 2001/09/02 14:05:58 aaron Exp $ +.\" $OpenBSD: sh.1tbl,v 1.29 2002/05/04 22:21:21 krw Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -1370,6 +1370,74 @@ represent itself it must be quoted or appear later in the list. Like .Ic \&[ Ns No .. Ns Ic \&] , except it matches any character not inside the brackets. +.Sm on +Matches any string of characters that matches zero or more occurrences of the +specified patterns. +Example: The pattern +.Ic \&*(foo\&|bar) +matches the strings +.Dq , +.Dq foo , +.Dq bar , +.Dq foobarfoo , +etc. +.Sm off +.It Xo Ic \&+( Ar pattern Ic \&| No \ ...\ +.Ic \&| Ar pattern Ic \&) +.Xc +.Sm on +Matches any string of characters that matches one or more occurrences of the +specified patterns. +Example: The pattern +.Ic \&+(foo\&|bar) +matches the strings +.Dq foo , +.Dq bar , +.Dq foobar , +etc. +.Sm off +.It Xo Ic \&?( Ar pattern Ic \&| No \ ...\ +.Ic \&| Ar pattern Ic \&) +.Xc +.Sm on +Matches the empty string or a string that matches one of the specified +patterns. +Example: The pattern +.Ic \&?(foo\&|bar) +only matches the strings +.Dq , +.Dq foo +and +.Dq bar . +.Sm off +.It Xo Ic \&@( Ar pattern Ic \&| No \ ...\ +.Ic \&| Ar pattern Ic \&) +.Xc +.Sm on +Matches a string that matches one of the specified patterns. +Example: The pattern +.Ic \&@(foo\&|bar) +only matches the strings +.Dq foo +and +.Dq bar . +.Sm off +.It Xo Ic \&!( Ar pattern Ic \&| No \ ...\ +.Ic \&| Ar pattern Ic \&) +.Xc +.Sm on +Matches any string that does not match one of the specified patterns. +Examples: The pattern +.Ic \&!(foo\&|bar) +matches all strings except +.Dq foo +and +.Dq bar ; +the pattern +.Ic \&!(\&*) +matches no strings; the pattern +.Ic \&!(\&?)\&* +matches all strings (think about it). .El .Pp Note that |