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 $NAMEdone < some.csvAnd 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 DESCwhile read $FIELDS; do     echo $NAMEdone < some.csvbut 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? 
In BASH is there a way to read Variable names from a variable?
bash;variable
I'm guessing you've set IFS to , to parse the CSV. At least when I do that I get the same error message you're getting:IFS=,FIELDS=NAME PRETTY_NAME DESCwhile read $FIELDS; do    echo $NAMEdone < some.csvThat's because the shell parses read $FIELDS using $IFS, so it looks for , to separate the arguments; thus NAME PRETTY_NAME DESC ends up being interpreted as a single argument instead of three, and the result is an invalid identifier name.Using an array as suggested by GMaster works in this case:IFS=,FIELDS=(NAME PRETTY_NAME DESC)while read ${FIELDS[@]}; do   echo $NAMEdone < some.csv