[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to read fields into an array?
From: |
Linda Walsh |
Subject: |
How to read fields into an array? |
Date: |
Fri, 01 Aug 2014 17:05:51 -0700 |
User-agent: |
Thunderbird |
I tried setting a var as an array:
declare -a var
and then doing a read
read var
Is there a way to get arrays to work with read directly and
not doing something like a split on space into multiple lines and
use readarray w/that?
It seems like it would make sense if the "declare -a var"
actually had some effect on the subsequent read as
it does in subsequent assignments, for example.
Is there some syntax in the read to do it? (${a[@]} ?
- How to read fields into an array?,
Linda Walsh <=