The post marked as duplicate above is similar, however is not sufficient for the use case. The below answers show a minimalist use of the read command to put parsed input for a known length of delimiter separated values into helpfully-named variables. For instance, if I read all four vars into $STATEMENTS,$BRANCHES,$FUNCTIONS,$LINES - a loop is not ideal as it adds a minimal of loop index awareness or 4 more lines to put each array var into a helpfully named var.
I have a list of comma separated numbers in a file:
26.16,6.89,23.82,26.17
I'd like to read these 4 numbers into helpfully named separate variable names - there will never fewer or more than 4 numbers.
Thanks for any help!