Hi,
to read all emails into an array:
Code:
email=( $(cat file) )
to convert the array to a list:
Code:
CC=$(for i in {2..${#email[@]}}; do printf "%s " ${email[$i]}; done)
Which iterates over the array starting at position 2 for the length of the array, the it prints the current array followed by a space but no line break. The result is passed to the variable CC. Now you have the TO in $TO and the CC in $CC.
HTH
Chris