I have a bash array OUTARRAY that I fill will values from processing an INARRAY. I frequently append to OUTARRAY special chars, namely \t and \n
so it may look like:
OUTARRAY[j]="\n"
or
OUTARRAY[j]="${INARRAY[i]}\t"
in the end I dump the OUTARRAY in a file using
printf "%s" "${OUTARRAY[@]}" > ${OUTFILE}
the result I get however is, a single line file with all the special chars printed within:
\n2771\t2899\t7624\t2911\t\n2772\t2904\t7706\t2911\t\n2771\t2909
Instead, I want columned output. Something like
2771 2899 7624 2911
2772 2904 7706 2911
and so on. what do I do wrong? thank you