Hello, This patch adds two missing entries into the Parameter Expansion's subsection on Case Modification of the Bash man page.
Problem:
The "Parameter Expansion" section of doc/bash.1 currently does not
document the behavior of the `${parameter~pattern}` or
`${parameter~~pattern}` operators.
Fix:
Add these two operators to doc/bash.1 in alongside the other case modification
operators (`${parameter^pattern}`, `${parameter^^pattern}`, etc.).
Also update the body of this section to include the behavior of these
operators.
Patch attached. Generated with `git format-patch`.
Thank you for your hard work maintaining Bash!
Best,
Connor Wilkins
---
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
0001-doc-missing-parameter-expansion-operators-in-bash-1.patch
Description: 0001-doc-missing-parameter-expansion-operators-in-bash-1.patch
