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.

  imadev:~$ IFS='+x'
  imadev:~$ echo ${!P*}
  P4CLIENT PAGER PATH PIPESTATUS PKG_CONFIG_PATH PPID PS1 PS2 PS4 PWD
  imadev:~$ echo "${!P*}"
  P4CLIENT+PAGER+PATH+PIPESTATUS+PKG_CONFIG_PATH+PPID+PS1+PS2+PS4+PWD

Or, using a special script to see the arguments more clearly:

  imadev:~$ args ${!P*}
  10 args: <P4CLIENT> <PAGER> <PATH> <PIPESTATUS> <PKG_CONFIG_PATH> <PPID> 
<PS1> <PS2> <PS4> <PWD>
  imadev:~$ args "${!P*}"
  1 args: <P4CLIENT+PAGER+PATH+PIPESTATUS+PKG_CONFIG_PATH+PPID+PS1+PS2+PS4+PWD>

I believe this is intended behavior (since it matches how $* works),
and that the man page is simply misleading.

Reply via email to