holzhey@ppprs1.phy.tu-dresden.de wrote:
> IFS="/" read -r -d $'\000' -a uu <<< /kghfjk/jkfzuk/i
>
> now I check, what is in 'uu':
>
> declare -p uu produces:
> declare -a uu='([0]="" [1]="kghfjk" [2]="jkfzuk" [3]="i\
> ")'
>
> The first strange thing is, that field number 3 ends with a
> newline. But maybe tis is what you want and I just don't understand.
I think this is the expected behavior. When you use "<<<", the
command's input is the given string followed by a newline, although
the documentation does not mention the added newline. Then since you
used "-d $'\000'", that newline is not treated as the end of input by
the read command.
> [ "${uu[0]}" = $'\177' ] && echo yes produces:
> yes
>
> This definitely seems to be a bug.
I agree.
paul