From 30996a791c474d78209b9d77436c3d40a7276a1a Mon Sep 17 00:00:00 2001
From: Kolkhis <36500473+Kolkhis@users.noreply.github.com>
Date: Tue, 26 Aug 2025 14:57:29 -0400
Subject: [PATCH] doc: missing parameter expansion operators in bash(1)

Add two missing parameter expansion operators for case modification to the
Parameter Expansion section, alongside the other Case Modification parameter
expansions:
${parameter^pattern}, ${parameter^^pattern}, ${parameter,pattern}, and
${parameter,,pattern}.

Update the body of this section to include the "toggle/invert case" behavior
of these operators.
---
 doc/bash.1 | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/doc/bash.1 b/doc/bash.1
index 5af3492f..849c3da6 100644
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -3982,6 +3982,10 @@ ${\fIparameter\fP\fB\*^\*^\fP\fIpattern\fP}
 ${\fIparameter\fP\fB,\fP\fIpattern\fP}
 .TP
 ${\fIparameter\fP\fB,,\fP\fIpattern\fP}
+.TP
+${\fIparameter\fP\fB~\fP\fIpattern\fP}
+.TP
+${\fIparameter\fP\fB~~\fP\fIpattern\fP}
 .PD
 \fBCase modification\fP.
 This expansion modifies the case of alphabetic characters in \fIparameter\fP.
@@ -3999,13 +4003,16 @@ Using
 .Q \*^
 converts lowercase letters matching \fIpattern\fP to uppercase;
 .Q ,
-converts matching uppercase letters to lowercase.
+converts matching uppercase letters to lowercase;
+.Q ~
+inverts the case of matching letters: uppercase letters are converted to 
+lowercase, and lowercase letters converted to uppercase.
 The
-\fB\*^\fP and \fB,\fP variants
+\fB\*^\fP and \fB,\fP and \fB~\fP variants
 examine the first character in the expanded value
 and convert its case if it matches \fIpattern\fP;
 the
-\fB\*^\*^\fP and \fB,,\fP variants
+\fB\*^\*^\fP and \fB,,\fP and \fB~~\fP variants
 examine all characters in the expanded value
 and convert each one that matches \fIpattern\fP.
 If \fIpattern\fP is omitted, it is treated like a \fB?\fP, which matches
-- 
2.34.1

