This is a bash question (hence posting here in Unix&Linux)
I have a while loop that reads from a csv; It looks something like this:
while read NAME PRETTY_NAME DESC; do echo $NAME done < some.csv
And that all works lovely; but what I'd really love to do is define the field names in a variable; like this:
FIELDS="NAME PRETTY_NAME DESC" while read $FIELDS; do echo $NAME done < some.csv
but unfortunately it seems that is not acceptable:
-bash: read: `NAME PRETTY_NAME DESC': not a valid identifier
:( Any ideas if (or preferably how) this is possible?