Unix mail with blank line on variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix mail with blank line on variable
# 1  
Old 12-08-2008
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  
Old 12-08-2008
Please post your script

Please post your script so that we can troubleshoot
# 3  
Old 12-09-2008
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=$?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

In a file, replace blank line by the last line not blank above

Dear All, In a CSV file, say that a given column has been extracted. In that column, information is missing (i.e. blank lines appear). I would like to replace the blank lines by the last valid line (not blank) previously read. For example, consider the extract below: 123 234 543 111... (7 Replies)
Discussion started by: bagvian
7 Replies

2. Shell Programming and Scripting

How to read a two files, line by line in UNIX script and how to assign shell variable to awk ..?

Input are file and file1 file contains store.bal product.bal category.bal admin.bal file1 contains flip.store.bal ::FFFF:BADC:CD28,::FFFF:558E:11C5,6,8,2,1,::FFFF:81C8:CA8B,::FFFF:BADC:CD28,1,0,0,0,::FFFF:81C8:11C5,2,1,0,0,::FFFF:81DC:3111,1,0,1,0 store.bal.... (2 Replies)
Discussion started by: veeruasu
2 Replies

3. UNIX for Advanced & Expert Users

UNIX mail blank in the TO address

Hi All, Can we send a mail in unix blank in TO address with CC and BCC. TO address should be blank CC should not be blank BCC should not be blank thanks, (7 Replies)
Discussion started by: kiranparsha
7 Replies

4. Shell Programming and Scripting

Remove Space and blank line from file in UNIX shell script

I have below file. I want to remove space at begining of every line and then after also remove blank line from file. I use below code for each operation. sed -e 's/^*//' < check.txt > check1.txt sed '/^\s*$/d' < check1.txt > check2.txt above code not remove all the space... (12 Replies)
Discussion started by: Mohin Jain
12 Replies

5. Shell Programming and Scripting

how to append blank line in multiple files in unix

Dear All- Please suggest a single unix command which can append blank line in multiple files. I need to achieve this using a single unix command and not a script Please do advice Regards, Suresh (2 Replies)
Discussion started by: sureshg_sampat
2 Replies

6. Shell Programming and Scripting

Blank as variable/output when run from command line

When I run this: PDHDURL=`/usr/bin/curl --silent http://www.phdcomics.com/comics.php | /usr/bin/grep -o http://www.phdcomics.com/comics/archive/.*.gif | head -1` echo -e "$PHDURL" It is totally blank. However, when I just run it from the terminal: /usr/bin/curl --silent... (2 Replies)
Discussion started by: killer54291
2 Replies

7. Shell Programming and Scripting

Fill the empty line by adding line before blank line

FIle A "A" 2 aa 34 3 ac 5 cd "B" 3 hu 67 4 fg 5 gy output shud be A"" 2 aa 34 "A" 3 ac 34 "A" 5 cd 34 "B" 3 hu 67 "B" 4 fg 67 "B" 5 gy 67 (6 Replies)
Discussion started by: cdfd123
6 Replies

8. Shell Programming and Scripting

Unix help to find blank lines in a file and print numbers on that line

Hi, I would like to know how to solve one of my problems using expert unix commands. I have a file with occasional blank lines; for example; dertu frthu fghtu frtty frtgy frgtui frgtu ghrye frhutp frjuf I need to edit the file so that the file looks like this; (10 Replies)
Discussion started by: Lucky Ali
10 Replies

9. Shell Programming and Scripting

Replace two blank line with a single blank line

Hi Guys, I have a file in which each set of records are separated by two blank line. I want to replace it with a single blank line. Can you guys help me out? Regards, Magesh (9 Replies)
Discussion started by: mac4rfree
9 Replies

10. Shell Programming and Scripting

E-Mail from command line for UNIX and Perl??

Hi Is there any way to use UNIX and Perl to automate sending e-mail. I got a dynamic changing file that send out to people in my mailing list and want to experinment to see if Perl and UNIX can send it out for me when the content is change. I found a Perl source code but dont really know how to... (4 Replies)
Discussion started by: jy2728
4 Replies
Login or Register to Ask a Question