[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: documentation for ${!prefix*} is misleading
From: |
Greg Wooledge |
Subject: |
Re: documentation for ${!prefix*} is misleading |
Date: |
Tue, 10 Aug 2010 10:43:48 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Tue, Aug 10, 2010 at 04:15:30PM +0200, Andreas Schwab wrote:
> Greg Wooledge <wooledg@eeg.ccf.org> writes:
>
> > The 4.1 man page says:
> >
> > ${!prefix*}
> > ${!prefix@}
> > 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.
I'd suggest some wording like this:
${!prefix*}
${!prefix@}
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. When @ is used
and the expansion appears within double quotes, each variable
name expands to a separate word.