read: Support arrays, character splitting

Enhance the `read` builtin to support creating an array with the --array
flag. With --array, only a single variable name is allowed and the
entire input is tokenized and placed into that variable as an array.

Also add custom behavior if IFS is empty or unset. In that event, split
the input on every character, instead of the previous behavior of doing
no splitting at all.
This commit is contained in:
Kevin Ballard
2014-07-13 22:36:26 -07:00
parent 72e8489d50
commit 973dd6ffbd
7 changed files with 180 additions and 10 deletions

0
tests/read.err Normal file
View File