mailx command


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users mailx command
# 8  
Old 02-05-2009
Hammer & Screwdriver

After you set your date from Oracle, try to show it like the following:

Code:
> dt_a="03-07-2008"
> echo ${dt_a}
03-07-2008
> echo ${dt_a} | od -An -t dC -w10
   48   51   45   48   55   45   50   48   48   56
   10

Those are the ASCII representations of the text. You can look up the ASCII table, but 48 is a "0" & 51 is a "3" & 45 is a "-" and so on. The 10 is a line-feed.

I am curious if there are some control characters like tab or carriage-return or something else that is somehow part of the string.
# 9  
Old 02-06-2009
Hi all,

The value of week_end_date is coming properly. There is no problem in echoing that. The problem is that value is not displayed in the subject of the mail. On the contrary if I specify $week_end_date in the text part of the mail then it is displaying it properly. I am writing the code again with proper output. kindly check the same

Quote:
#!/bin/ksh

week_end_dt=`sqlplus -s rsamart@martdev.world/rsamart<<EOF
SET FEED OFF;
SET TIMING OFF;
SET HEADING OFF;
SET PAGESIZE 500;
SET LINESIZE 1000;
select to_char(max(week_date),'MM-DD-YYYY') from RM_EV_WEEK_LKP;
SET HEADING ON;
exit;
EOF`

export a=$week_end_dt
echo "this is the value of week_end_dt"
echo $week_end_dt

subject="Early view data completed $week_end_dt"
#subject=$week_end_dt
echo "this is the value of subject"
echo $subject

echo The content is of "$subject"
echo The content to "$week_end_dt"

echo "" | mailx -s "$subject" abc@xyz.com

exit 0
the ouptut is

Quote:
:-} cat RM_post_EV_build_alert.sh_out
this is the value of week_end_dt
03-07-2008
this is the value of subject
Early view data completed 03-07-2008
The content is of Early view data completed
03-07-2008
The content to
03-07-2008

and the mail which i get has subject as shown below

Quote:
To abc@xyz.com

cc
Subject Early view data completed

Hope these things will help u all to understand now.

waiting for reply.

Thanks.
# 10  
Old 02-06-2009
please reply asap!!!!
# 11  
Old 02-06-2009
Are you reading reply to your questions?
Why you did not make what you have been asked?
People spend time to get your problem, try it, think about it, replay you, but you do not care, repeating the same and, even, 'asap'!
I am sure you have 'lf' in your data and if you would do what I asked you to do or, even better, apply the 'od' command as it was advised, you would see it.
I do not see a reason to spend time for this thread and it is my last post here.
You can continue just to do the same and repeat it again and again. Good lock!

(Sorry for off-top)
# 12  
Old 02-09-2009
Quote:
Originally Posted by alex_5161
Are you reading reply to your questions?
Why you did not make what you have been asked?
People spend time to get your problem, try it, think about it, replay you, but you do not care, repeating the same and, even, 'asap'!
I am sure you have 'lf' in your data and if you would do what I asked you to do or, even better, apply the 'od' command as it was advised, you would see it.
I do not see a reason to spend time for this thread and it is my last post here.
You can continue just to do the same and repeat it again and again. Good lock!

(Sorry for off-top)
Alex,

For your kind information i have already tried your method i.e. ">${week_end_dt}<" to include in the subject. but its not working. I dont know why. probably it might be working for u. For the same reason i am repeating my code in this thread to get u all the better idea. Regarding the 'od' command i dint get time to check thru it. i was in hurry when i lastly posted.

By the way thanks for your precious time. I am really glad to have ur suggestions.Smilie
# 13  
Old 02-10-2009
Hi all,

I got the solution to my question. Sometimes we think too complex solutions for the simple questions.SmilieSmilie
The subject just required to be assigned with echo command to get it displayed in the mail.

Code:
subject=`echo Early view data mart build completed on $week_end_dt`

This resolves the problem.
Thanks for your valuable efforts.
# 14  
Old 02-10-2009
Quote:
Originally Posted by Jalkukdi@10
Hi all,

I got the solution to my question. Sometimes we think too complex solutions for the simple questions.SmilieSmilie
The subject just required to be assigned with echo command to get it displayed in the mail.

Code:
subject=`echo Early view data mart build completed on $week_end_dt`

This resolves the problem.
Thanks for your valuable efforts.
Hmm, interesting, I wonder if that is something to do with the way oracle is assigning the variable $week_end_dt

As an aside, what unix are you running? and what version of oracle?

Thanks for letting us know you've got it sorted
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Mailx command

Using RHEL 5.5 New to using 'mailx' Was trying to check if mailx is configured. mailx command gives a list of unread mails. Now I tried to send mail using this command to a local or on network machine using mailx -s "Test2" "root@<servername>" But did not receive any message. (6 Replies)
Discussion started by: ikn3
6 Replies

2. UNIX for Dummies Questions & Answers

mailx command

Hi, I am seeing that this command is sending mail even when the nawk command in untrue ( does not have any output ). I only want it to send mail, where it goes above the threshold, and has some output. nawk -F'(MOD dn="uid=)|(DEL dn="uid=)|' '/(MOD dn="uid=)|(DEL dn="uid=)/... (2 Replies)
Discussion started by: john_prince
2 Replies

3. Solaris

mailx command

Dear all, Every time if i use mailx it is asking for entering the From Address. I want to set it in some place, So that it will take it by default whenever we send mails. Pl help on this. Regards JeganR (2 Replies)
Discussion started by: jegaraman
2 Replies

4. Solaris

Mailx command

HI All, I have an unix server , where sendmail command works for sending mail. But if i use mailx command it is not working. Is there any specific settings needed for this. Kindly help. Thanks and Regards Rj (1 Reply)
Discussion started by: jegaraman
1 Replies

5. Shell Programming and Scripting

Mailx: How to send a attachment using mailx command

Hi All, Can anyone please provide the command for sending an mail with attachment using mailx command. Thanks in Advance :) Regards, Siram. (3 Replies)
Discussion started by: Sriram.Vedula53
3 Replies

6. UNIX for Dummies Questions & Answers

mailx and -s command

How does the -s command work with mailx. I know that -s is to create a symbolic link when being used with ln but i'm not sure what the command does with mailx. Anyone?:confused: (1 Reply)
Discussion started by: kjetterman
1 Replies

7. UNIX for Dummies Questions & Answers

help on mailx command

hi, i want to pass a unix variable as the subject of the mail alongwith a string. My part of code is as below.. week_end_dt=`sqlplus -s rsamart@martdev.world/rsamart<<EOF SET FEED OFF; SET TIMING OFF; SET HEADING OFF; SET PAGESIZE 500; SET LINESIZE 1000; select... (1 Reply)
Discussion started by: Jalkukdi@10
1 Replies

8. Shell Programming and Scripting

mailx command help

Dear All, I need to send a mail to a group ( the address of which is in a .profile file)..My basic mailing functionality isn't working. When i try to run mailx -s "Hello" abc@xyz.com the command does not return to the prompt an runs infinitely. Request you to help me out here along with... (3 Replies)
Discussion started by: kaushikraman
3 Replies

9. UNIX for Advanced & Expert Users

Mailx Command

Hi, mailx -s "hi" -r "abc@yahoo.com" aaa@yahoo.com<<EOF Hi, ~<!uuencode a.txt a.txt EOF the above code is sending mails, but attachment is not going instead i just get like below ~<!uuencode a.txt a.txt Thanks. (3 Replies)
Discussion started by: shahnazurs
3 Replies

10. Shell Programming and Scripting

mailx command

Hi friends, i have seen the following line in some unix shell script . can some one explain me what exactly the statement is meant for ? ========================================================= mailx -s " Master Data Transmission Report for $TODAY at $TIME " < /etc/tr/tmp/$tmplog... (5 Replies)
Discussion started by: sveera
5 Replies
Login or Register to Ask a Question