bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Empty trailing fields ignored by read


From: DJ Mills
Subject: Re: Empty trailing fields ignored by read
Date: Thu, 29 Aug 2013 12:57:22 -0400

On Thu, Aug 29, 2013 at 12:42 PM, DJ Mills <danielmills1@gmail.com> wrote:

> When using a non-default IFS (a default IFS would trim them), a single
> empty trailing field is ignored for read -a.
>
> IFS=: read -rd '' -a arr < <(printf %s ':foo:bar:'); printf '<%s> '
> "${arr[@]}"; echo
> <> <foo> <bar>
>
> I would expect the output to be:
> <> <foo> <bar> <>
>

By the way, this is on 4.2.45(2)-release, but it also occurs on
4.2.45(1)-release and 3.2.51(1)-release.

A workaround is to use < <(printf %s: "$foo"), but that shouldn't be needed.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]