Hi everyone...
I am facing problem with the multiple mail attachments.
cd /work/mohan/pi_log/
mail_file='uuencode ahmedabad.csv ahmedabad.csv ; uuencode ahmedabad_devrpt_20110530.csv ahmedabad_devrpt_20110530.csv'
( $mail_file ) | mailx -m -s"test" domain@website.com
its giving me error like
but same code work well for sending single file as attachment.
Where i am going wrong???
because of your command is like working after shell's comma interpretation as like this..
uuencode ahmedabad.csv ahmedabad.csv ';' uuencode ahmedabad_devrpt_20110530.csv ahmedabad_devrpt_20110530.csv
so you must use `eval` [from eval man pages .. concatenated together into a single command] for correct interpret
mail_file='uuencode ahmedabad.csv ahmedabad.csv ; uuencode ahmedabad_devrpt_20110530.csv ahmedabad_devrpt_20110530.csv'
( eval $mail_file ) | mailx -s"test" domain@website.com
equals to (no error)
uuencode ahmedabad.csv ahmedabad.csv
uuencode fopen-ing ahmedabad_devrpt_20110530.csv
regards
ygemici