public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/devmanual:master commit in: tools-reference/bash/
Date: Fri, 10 Jun 2022 17:15:52 +0000 (UTC)	[thread overview]
Message-ID: <1654881247.7d05c22848ed37bf5b594a30e56ee2793d1b1afb.ulm@gentoo> (raw)

commit:     7d05c22848ed37bf5b594a30e56ee2793d1b1afb
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  4 21:24:47 2022 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Jun 10 17:14:07 2022 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=7d05c228

tools-reference/bash: Add tables of metacharacters and constructs

Parts of this have been taken from the Bash Reference Manual authored by
Chet Ramey and Brian Fox. See https://bugs.gentoo.org/829916#c9.

Closes: https://bugs.gentoo.org/829916
Reported-by: Alexis <flexibeast <AT> gmail.com>
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 tools-reference/bash/text.xml | 61 ++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 54 insertions(+), 7 deletions(-)

diff --git a/tools-reference/bash/text.xml b/tools-reference/bash/text.xml
index 092e95d..5e541ca 100644
--- a/tools-reference/bash/text.xml
+++ b/tools-reference/bash/text.xml
@@ -667,18 +667,65 @@ The <c>pattern</c> may contain a number of special metacharacters for pattern
 matching.
 </p>
 
-<todo>
-tables of bash metachars
-</todo>
+<table>
+<tr>
+  <th>Character</th>
+  <th>Meaning</th>
+</tr>
+<tr>
+  <ti><c>*</c></ti>
+  <ti>Matches any string, including the null string</ti>
+</tr>
+<tr>
+  <ti><c>?</c></ti>
+  <ti>Matches any single character</ti>
+</tr>
+<tr>
+  <ti><c>[...]</c></ti>
+  <ti>Matches any one of the enclosed characters</ti>
+</tr>
+</table>
+
+<p>
+Refer to the
+<uri link="https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html">
+Bash Reference Manual</uri> for further details and caveats regarding these
+characters.
+</p>
 
 <p>
 If the <c>extglob</c> shell option is enabled, a number of additional constructs
-are available. These can be <e>extremely</e> useful sometimes.
+are available. These can be <e>extremely</e> useful sometimes. In the following
+table, a <c>pattern-list</c> is a list of one or more patterns separated by
+<c>|</c>.
 </p>
 
-<todo>
-table of extra bash goodies
-</todo>
+<table>
+<tr>
+  <th>Construct</th>
+  <th>Meaning</th>
+</tr>
+<tr>
+  <ti><c>?(pattern-list)</c></ti>
+  <ti>Matches zero or one occurrence of the given patterns</ti>
+</tr>
+<tr>
+  <ti><c>*(pattern-list)</c></ti>
+  <ti>Matches zero or more occurrences of the given patterns</ti>
+</tr>
+<tr>
+  <ti><c>+(pattern-list)</c></ti>
+  <ti>Matches one or more occurrences of the given patterns</ti>
+</tr>
+<tr>
+  <ti><c>@(pattern-list)</c></ti>
+  <ti>Matches one of the given patterns</ti>
+</tr>
+<tr>
+  <ti><c>!(pattern-list)</c></ti>
+  <ti>Matches anything except one of the given patterns</ti>
+</tr>
+</table>
 
 </body>
 </subsection>


             reply	other threads:[~2022-06-10 17:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10 17:15 Ulrich Müller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-27  9:02 [gentoo-commits] proj/devmanual:master commit in: tools-reference/bash/ Ulrich Müller
2022-05-27  9:02 Ulrich Müller
2022-05-27  9:02 Ulrich Müller
2022-05-27  9:02 Ulrich Müller
2022-05-27  9:02 Ulrich Müller
2021-03-21  5:48 Ulrich Müller
2021-03-12 22:03 Ulrich Müller
2021-03-12 22:03 Ulrich Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1654881247.7d05c22848ed37bf5b594a30e56ee2793d1b1afb.ulm@gentoo \
    --to=ulm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox