Hei!
Creating a simple array, I am just wondering why the second printf line
does not print any results from the array at all.
I was assuming it would print the "two" and "three" lines in the array.
Thanks for feedback!
#!/bin/bash
MyData="One,two,three"
declare -i q
OIFS=$IFS
IFS=$','
for myColumn in $MyData; do
MyArray[q++]="${myColumn#*}"
printf "%s\n" "$q: ${MyArray[q-1]}"
printf "%s\n" "$q: ${MyArray[q]}"
done
IFS=$OIFS
Best regards,
Richard Taubo