RE: [suse-programming-e] [Suse 8.0] Send a file attachment Using mutt in a shell script..
The subject of the mutt command should be in quotes. Also it would be
better if you included the full path name for "answer1".
-----Original Message-----
From: robert guru [mailto:sos_linux@hotmail.com]
Sent: Tuesday, May 17, 2005 2:51 AM
To: suse-programming-e@suse.com
Subject: [suse-programming-e] [Suse 8.0] Send a file attachment Using
mutt in a shell script..
hallo,
I' m trying to create a shell script that search for some files named
'answer', and for each file founded, the shell script have to email it as an
attachment using the 'mutt' program.
My script is
############### the script ####################
#!/bin/bash
lancer="/usr/bin/mutt -x"
for i in $(ls -p)
do
case $i in
*/) cd $i; pth=$PWD;
for sname in $(ls)
do
case $sname in
answer*) ii=`basename $i`;
comm=$lancer" -s THE_RESULT -a
"$sname" "$ii" < a_text_file";
echo $comm;
result=`$comm`;
esac
done
cd ..;;
esac
done
########## The result of the shell script ###########
echo $comm:
---> /usr/bin/mutt -x -s THE_RESULT -a answer1 sos_linux@hotmail.com <
a_text_file
( for this example, the file answer1 exists in
/home/account/sos_linux@hotmail.com
so here $ii is sos_linux@hotmail.com )
result=`$comm`:
---> deadlock, this command can not be completed,(in the case of ... "$ii"
< a_text_file")
---> show the message "No recipients specified." in the case of ...
"$ii"
participants (1)
-
Wenzel, Scott