![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 check the variable values is blank | julirani | Shell Programming and Scripting | 2 | 12-06-2008 05:24 PM |
| sed: delete regex line and next line if blank | one71 | Shell Programming and Scripting | 2 | 09-18-2008 05:53 AM |
| [bash] Check if variable is set or blank | noratx | Shell Programming and Scripting | 1 | 03-28-2008 09:42 AM |
| reading a line into a variable in unix | lmadhuri | UNIX for Dummies Questions & Answers | 1 | 02-07-2007 10:04 AM |
| E-Mail from command line for UNIX and Perl?? | jy2728 | Shell Programming and Scripting | 4 | 11-26-2002 05:02 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Unix mail with blank line on variable
I am testing a ksh script for email.
In the subject/content of the mail there is some dynamic variables like date and charges. However these variables occupied the entire line erase other in that particular line For e.g. there is a mail message: This mail is intent... Your total credit expenses of <<$USD amount>> for this period is .. and you need to confirm the reciep... This should be mailed as follows however it executed as the next one This mail is intent... Your total credit expenses of $100.00 for this period is .. and you need to confirm the reciep... Executed one This mail is intent... $100.00 and you need to confirm the reciep... Any suggestions... |
|
||||
|
A portion of script here mail in MAIL_DRAFT file will send by replace the AMOUNT and DATE value:
CURRENTDATE=`date +%d" "%B" "%Y` awk '{if ($0~/\$000.00/) {printf "\t\t\t$%s\n", AMOUNT} else if ($0~/DD MM YYYY/) {printf "DATE %s\n", DATE VALUE} else {print $0}}' AMOUNT=$charge DATEVALUE="$CUR_DATE" $MAIL_DRAFT >> $MAIL_FILE /usr/lib/sendmail -t < $MAIL_FILE SENDMAILSTATUS=$? |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| format, mail, mail merge, substitution |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|