Configuration Information [Automatically generated, do not change]: Machine: i486 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../bash/include -I../bash/lib -g -O2 -Wall uname output: Linux hayes 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux Machine Type: i486-pc-linux-gnu
Bash Version: 3.2 Patch Level: 39 Release Status: release Description: While the first few parameter expansion operator entries include a brief summary of what the entity does (in bold), the last several do not. One has to read and parse quite a bit of text to even get a hint of what some of the operators do. Entry D3 in the FAQ, though, does show summaries for a few of those operators, and I thought the bash(1) manual page would benefit by the addition of similar summaries. Repeat-By: man bash /^ *Parameter Expansion ... Fix: I'll try to include a patch at the bottom of this report, below, generated by diff -u. FYI, following are the entries with just the added text summaries shown: ${!prefix*} [EMAIL PROTECTED] Expand to names matching prefix. [EMAIL PROTECTED] ${!name[*]} Expand to array indices/keys. ${#parameter} Parameter length. ${parameter#word} ${parameter##word} Remove smallest or largest prefix pattern. ${parameter%word} ${parameter%%word} Remove smallest or largest suffix pattern. ${parameter/pattern/string} Pattern substitution. Thanks, Ken $ cat ~/tmp/bash-manpage-fix/bash-3_2-manpage-hints.patch --- bash.1 2008-10-24 09:49:30.000000000 -0800 +++ ki-bash.1 2008-10-24 10:40:05.000000000 -0800 @@ -2437,6 +2437,7 @@ .TP [EMAIL PROTECTED] .PD +\fBExpand to names matching prefix\fP. Expands to the names of variables whose names begin with \fIprefix\fP, separated by the first character of the .SM @@ -2448,6 +2449,7 @@ .TP ${\fB!\fP\fIname\fP[\fI*\fP]} .PD +\fBExpand to array indices/keys\fP. If \fIname\fP is an array variable, expands to the list of array indices (keys) assigned in \fIname\fP. If \fIname\fP is not an array, expands to 0 if \fIname\fP is set and null @@ -2456,6 +2458,7 @@ key expands to a separate word. .TP ${\fB#\fP\fIparameter\fP} +\fBParameter length\fP. The length in characters of the value of \fIparameter\fP is substituted. If .I parameter @@ -2477,6 +2480,7 @@ .TP ${\fIparameter\fP\fB##\fP\fIword\fP} .PD +\fBRemove smallest or largest prefix pattern\fP. The .I word is expanded to produce a pattern just as in pathname @@ -2509,6 +2513,7 @@ .TP ${\fIparameter\fP\fB%%\fP\fIword\fP} .PD +\fBRemove smallest or largest suffix pattern\fP. The \fIword\fP is expanded to produce a pattern just as in pathname expansion. If the pattern matches a trailing portion of the expanded value of @@ -2535,6 +2540,7 @@ array in turn, and the expansion is the resultant list. .TP ${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP} +\fBPattern substitution\fP. The \fIpattern\fP is expanded to produce a pattern just as in pathname expansion. \fIParameter\fP is expanded and the longest match of \fIpattern\fP