The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 11-18-2008
Christoph Spohr Christoph Spohr is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 205
Hi,

there is a small error in there. It has to be:

cc=$(for i in {2..${#email[@]}}; do printf "%s, " ${email[$i]}; done

The comma was missing as you need a comma separated list of repicipients.

I don't use mailx but mutt. The following line does the trick for me:

echo test | mutt -s test -c "$cc" -- $to

HTH Chris