I an creating a bash array:
for i in *.txt; do
arr2+=$(printf "%s\n" "${arr[@]: 0: 1} $arr[@]: 1: 1}")
done
echo "${arr2}"
The output is all on the same line ( when I use awk to get first column, only first element is returned).
How do I get each iteration of the for loop to put each new entry into the array on a newline?