The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-08-2008
balaji.rengaraj balaji.rengaraj is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 7
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...


  #2 (permalink)  
Old 12-08-2008
roopla roopla is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 8
Please post your script

Please post your script so that we can troubleshoot
  #3 (permalink)  
Old 12-09-2008
balaji.rengaraj balaji.rengaraj is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 7
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
Closed Thread

Bookmarks

Tags
format, mail, mail merge, substitution

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:56 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0