Hi,
That piece of code:
IFS=:
set -f
foo=a:b:
printf '<%s>\n' $foo
gives different results depending on the shell.
With pdksh, zsh, it gives:
<a>
<b>
<>
With bash, ksh, dash:
<a>
<b>
Also with the Bourne shell, but so does "a::b".
One would expect zsh's behavior if IFS is supposed to be a field
_separator_. On the other end, with zsh's behavior, there's no
way to distinguish between an empty list and a list with one
empty element.
But, with bash behavior, you can't loop through $PATH
components, as in $PATH, "/bin:" means ("/bin", ""), i.e. "/bin"
and the current directory.
The problem is I can't see that behavior documented clearly in
info -f bash -n 'Word Splitting'
regards,
Stephane