Greg Wooledge <wool...@eeg.ccf.org> writes: > On Tue, Aug 10, 2010 at 04:15:30PM +0200, Andreas Schwab wrote: >> Greg Wooledge <wool...@eeg.ccf.org> writes: >> >> > The 4.1 man page says: >> > >> > ${!prefix*} >> > ${!pre...@} >> > Names matching prefix. Expands to the names of variables whose >> > names begin with prefix, separated by the first character of the >> > IFS special variable. When @ is used and the expansion appears >> > within double quotes, each variable name expands to a separate >> > word. > >> > Actually, the IFS rule only applies when the "${!prefix*}" is quoted. > >> > I believe this is intended behavior (since it matches how $* works), >> > and that the man page is simply misleading. > >> Parameter expansion and word splitting are two separate steps. The >> quote above only talks about the former. > > Eh? The quote mentions the special behavior of the @ version, but not > the special behavior of the * version.
There is no special behaviour of the * version. > I'd suggest some wording like this: > > ${!prefix*} > ${!pre...@} > Names matching prefix. Expands to the names of variables whose > names begin with prefix. When * is used and the expansion > appears within double quotes, the names are separated by the > first character of the IFS special variable. This is wrong. This happens independent of whether it appears within double quotes. The quotes only make the difference of whether word splitting can be applied on the expansion (if word splitting is considered in the first place, which isn't in the case of a variable assignment, for example). Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."