I have a list of 20 e-mail addresses that I'm trying to put in a macro variable as multiple rows in a shell script. In wide format it works fine and appears as:to_list=email1@test.com,email2@test.com,email19@test.com,email20@test.comI want something like below, and I'm having trouble with the quotes, commas, and line breaks:to_list=email1@test.com,email2@test.com, \         .         .         .         email19@test.com,email20@test.comThe usage will be:mail -s Subject text here. $to_list < body_text.txtAccording to the syntax the e-mails should be comma separated and only the entire list should be wrapped in quotes as shown in the wide format. However, my test is only sending e-mails to the top row. I appreciate the insight!
Put long list of e-mail addresses in multiple-row macro variable
shell script;email;macro
You want something like this:to_list=(        email1@test.com,        email2@test.com,        email19@test.com,        email20@test.com        )mail -s Subject text here. ${to_list[@]} < body_text.txtThat is using an array, where you were trying to create a string. 