[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Empty trailing fields ignored by read
From: |
DJ Mills |
Subject: |
Empty trailing fields ignored by read |
Date: |
Thu, 29 Aug 2013 12:42:21 -0400 |
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> <>
- Empty trailing fields ignored by read,
DJ Mills <=