How to exit from mailx


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to exit from mailx
# 1  
Old 11-18-2011
How to exit from mailx

Hello Guys,
I have created function which is as follow:
My function is working, but it's waiting after executing mailx command. If user will press Ctrl+d then only it is executing subsequent lines. I treid couple of options such as quit, exit, ., ETO, but it's not working. Is any one can help me? how can I terminate mailx as end of message?

Best Regards,
Smilie

Last edited by kasparov; 11-18-2011 at 07:24 PM..
# 2  
Old 11-18-2011
mailx reads email from standard input. Since you haven't fed any input or file into it, it's trying to read from your keyboard.

Code:
mailx -s "New Email Found" $usr < messagefile

# 3  
Old 11-18-2011
Thanks for your quick reply, it works.Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need the difference between exit 1 & exit 7

Hi In one of the script I am seeing some thing like exit 7,exit 1,exit 2,exit 3,exit 9,exit6.What is the difference between all of this exit.Can anyone help here please (3 Replies)
Discussion started by: ginrkf
3 Replies

2. 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

3. UNIX for Dummies Questions & Answers

what is meaning of exit(0) and exit(1)

can u tell me what is the meaning of exit(0),exit(1),exit(2) what is diff amonng these. Amit (1 Reply)
Discussion started by: amitpansuria
1 Replies

4. Programming

exit(0) versus exit(1)

What is the difference between using exit(0) and exit(1) to exit a program? Which should I use? (9 Replies)
Discussion started by: enuenu
9 Replies

5. UNIX for Dummies Questions & Answers

EXIT STATUS on mailx/sendmail

Hi there I am using mailx command to send mails. I want to send some important files to team members and wud like to know if the team member has recd my email or not. How can I achieve this ? Currently my piece of code is uuencode ${FILE_NAME} ${FILE_NAME} >> mail_msg.txt mailx -s"test... (5 Replies)
Discussion started by: Amruta Pitkar
5 Replies

6. Shell Programming and Scripting

mailx

Hi, Thanks in Advance !! I have a korn script which is used to mail the reports to the users. I'm using the mailx utility. The uid used for running the script is "cronman", so the mails recieved by users are id FROM:"cronman". Now i want to change the FROM address to another user name... (2 Replies)
Discussion started by: pradeep_desh
2 Replies

7. UNIX for Advanced & Expert Users

MAILX help

Hello all, how do I view the default mail configurations using the mailx problem? At the moment, I have an account, and all the mail to that account is being routed to an email address, how can I view this behaviour? Also, is there anyway I can view the default mail settings for a server without... (0 Replies)
Discussion started by: Khoomfire
0 Replies

8. UNIX for Dummies Questions & Answers

mailx error message : mailx: NUL changed to @

If I use the "Mail" link instead of the "mail" link to ../mailx I get this error. Mail so-n-so @whatever.com mailx: NUL changed to @ Unknown command: "postmaster" The email still goes through but i get the error. If I use "mail" it goes thru without the error. Any ideas?? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

9. UNIX for Dummies Questions & Answers

Where can I find a list of exit codes? (Exit code 64)

I'm receiving an exit code 64 in our batch scheduler (BMC product control-m) executing a PERL script on UX-HP. Can you tell me where I can find a list of exit codes and their meaning. I'm assuming the exit code is from the Unix operating system not PERL. (3 Replies)
Discussion started by: jkuchar747
3 Replies

10. UNIX for Dummies Questions & Answers

Need help with mailx

How can I send a file of Unix usernames to everyone on the file without making an alias in my .mailrc file? Using a mailx command. Thanks, J.J. (2 Replies)
Discussion started by: JJJ
2 Replies
Login or Register to Ask a Question