|
Search Forums:
|
|||||||
| Forums | Register | Forum Rules | Linux and Unix Links | Man Pages | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
problem with attaching multiple attachments dynamically.
Guys, I've been trying to attach & email all txt files from my directory using the shell script below: Code:
#!/usr/bin/sh
################################################################################
send_ml_rej_notn()
{
FILE_NAME=${1}
ATTACH_FILE_NAME=`basename ${FILE_NAME}`
if [ -s ${MAIL_TXT} ]; then
( cat ${CUST_MAIL_HDR} ${MAIL_TXT} ${CUST_MAIL_FOOTER}; \
${FILE_NAME_AP} ${ATTACH_FILE_NAME} ) | mailx -r \
"$MAIL_SENDER" -m -s "${CONST_CUST_MAIL_SUB}" "${CONST_SUPPORT_MAIL_REPT}"
fi
}
ls *txt >${FILE_LIST}
cat ${FILE_LIST}| while read FILE_NAME
do
if [ -s ${FILE_NAME} ] ; then
FILE_NAME_AP="${FILE_NAME_AP} uuencode ${FILE_NAME} ${FILE_NAME} &&"
done
send_ml_rej_notn ${FILE_NAME_AP}-- The script does the emaling, however the attachments are missing. The body of the mail contains the message below: Code:
Usage: uuencode [ -m ] [ source ] remotedest Could someone offer guidance please?. All that I'm trying is to attach & email all txt files from my directory. Thank you!! -Bhagat Last edited by pludi; 05-19-2011 at 12:56 AM.. |
| Sponsored Links | ||
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Solaris 10, problem with attaching driver | solaris_user | Solaris | 3 | 04-02-2010 05:16 AM |
| Problem in attaching CVS file to the mail | alokjyotibal | Shell Programming and Scripting | 0 | 12-01-2009 05:08 AM |
| Problem with multiple excel attachments using mailx | ramanam2004 | UNIX for Advanced & Expert Users | 2 | 05-04-2006 01:07 AM |
| multiple attachments | edog | FAQ Submission Queue | 5 | 01-06-2003 01:09 PM |
| multiple attachments | edog | How do I send email? | 5 | 01-06-2003 01:09 PM |
|
|