![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to forward mail in /var/mail/username to external mail | unitipon | SUN Solaris | 2 | 05-27-2008 01:20 AM |
| Celebrate GnuPG's 10th birthday! | iBot | UNIX and Linux RSS News | 0 | 01-12-2008 04:10 PM |
| Mail Script need Help??? | gkrishnag | UNIX for Dummies Questions & Answers | 2 | 09-26-2006 01:32 AM |
| Happy birthday Linux | mib | News, Links, Events and Announcements | 1 | 06-30-2005 06:21 AM |
| I need a script that script extract info from mail | meravd | Shell Programming and Scripting | 1 | 10-19-2004 12:15 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Birthday Mail Script
Dear Friends
I want to, auto send mail to users on there Birthdate, using following script but while executing getting following error pls. suggest me for the same. Script :- #!/bin/sh data_file="/var/SCRIPTS/Birthday/data" email_file="/var/SCRIPTS/Birthday/birthday.email" today_month=`date +%m` today_day=`date +%d` today_date="$today_month,$today_day" all_friends="$(grep -v '^#' $data_file | grep $today_date)" for friend in $all_friends do email_addr=`$(echo $friend | cut -d , -f 5)` if [ -z $email_addr ]; then continue fi first_name="$(echo $friend | cut -d , -f 1)" last_name="$(echo $friend | cut -d , -f 2)" full_name="$first_name $last_name" sed "s/__FULLNAME__/$full_name/g"$email_file | \ echo "mail -s "Happy birthday to you.." $email_addr" done exit 0 Error O/p :- : command not founde 1: mailadmin@xyz.com : command not founde 1: sysadmin@xyz.com Data file :- First Name, Last Name, Month, Date, Mail ID XYZ,x,06,13,mailadmin@xyz.com ABC,S,07,13,sysadmin@xyz.com PQRj,sh,2,12,PQR@gmail.com Email File :- Dear __FULLNAME__: Happy Birthday To You. ![]() Best Regards, XYZ |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|