to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's
# 1  
Old 06-05-2008
to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's

Hi All,

Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'.

I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode' commands for the same and those worked fine. Please find below the same.

X " ( cat /sastemp/body.txt; uuencode test.xls test.xls ) | mailx -s 'testing' 'abcd.gef@yahoo.com' "

Instead using the X command I want to use system() function & ${} to make the above more successful.

Thanks in advance.

Thanks for your time,
Manas
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Set default return address for all mails sent from mailx

Hi, I have a question about mailx in Red Hat: If I use 'mail userid@mydomain.com -- -f root@mydomain.com', the return mail address will be root@mydomain.com. How can I make all mails sent from this system use root@mydomain.com as return address by default? Thank you in advance! nz (1 Reply)
Discussion started by: aixlover
1 Replies

2. Shell Programming and Scripting

Managing awk return code over SSH command

Hello all, This bellow code works. I'm just trying to find a simplified way to achieve this. I'm sure there is an easier way and it must be to simple for me to find. Verify that the OS version is 6.1. If not exit the script. Of course if i just put a && exit 1 at the end of the ssh... (11 Replies)
Discussion started by: maverick72
11 Replies

3. Shell Programming and Scripting

How to get the return code of subroutines executed as standalone as command line in Perl ?

How to do I get the return code of a subroutine in a perl module if invoke the subroutine as standalone, I have an module say TestExit.pm and in that i have a subroutine say myTest() which is returns 12, if i were to call the subroutine from command line like CASE:1 ( Without an explict... (2 Replies)
Discussion started by: ennstate
2 Replies

4. Shell Programming and Scripting

Pick up the return code for every iteration and display the result only once in loop.

Hi All, I amlearning UNIX scripting. I have a small query. I would be thankful if any one helps me out. I have a below piece of code which delets the files. If file dosent have the permissions to delete a particular file I have used 2>>operator to track the error code. But my objective is... (1 Reply)
Discussion started by: manas6
1 Replies

5. Shell Programming and Scripting

Return code of command assigned to variable

How do I evaluate the result of a command assigned to a variable?? Example: var1=`cmd` rc=$? rc will be the result of the assignment rather than cmd since it executes after. How do I evaluate the result of the command itself? Cheers..:confused: (2 Replies)
Discussion started by: browndr
2 Replies

6. Shell Programming and Scripting

return code of a unix command

How to find out whether the command I executed is successful or unsuccessful(at commandlinet) Eg: say i execute the following command at command line rm * How do i find out whether my previous command is a success or failure. Thankyou. Best Regards, Ram. (1 Reply)
Discussion started by: ramky79
1 Replies

7. Shell Programming and Scripting

Mailx Return Email Command

Hi, I'm trying to use the Mailx Return Email Command with a file attachment. If I use the file attachment by itself, it works ok. But If I add the return email command, it won't attach the file to email. Subject, return_email_address Send_email_address, Body, attachment,... (1 Reply)
Discussion started by: lisa0703
1 Replies

8. UNIX for Advanced & Expert Users

Move command return with exit code of 2

I have a script which loads data files into Oracle and then moves each file into a 'processed' directory when each file has finished loading. Last night I found that the script was failing on the mv statement (with a return code 2) and the following message, mv: cannot access... (1 Reply)
Discussion started by: handak9
1 Replies

9. Shell Programming and Scripting

Regex to pick up name from the following including carriage return at end of the line

has anyone got any suggestions how i would pick up the string as part of a substitution inclusive of the carriage return. ie i want to pick up <<NAME>> from the PS output but the <<; seems to be on the line before the NAME. Any ideas are appreciated! ... (3 Replies)
Discussion started by: Shakey21
3 Replies

10. UNIX for Advanced & Expert Users

mailx in kornshell script passing return code to CA-Unicenter

I have a KornShell script that has successfully been scheduled through Cron. We are in the process of changing over from Cron to using CA-Unicenter. To negative test the script I put a bad return code in. At the bottom of the script an e-mail is sent using mailx and then the return code is set... (1 Reply)
Discussion started by: Connie
1 Replies
Login or Register to Ask a Question
REPORTER-MAILX(1)						 LIBREPORT MANUAL						 REPORTER-MAILX(1)

NAME
reporter-mailx - Sends contents of a problem directory via email. SYNOPSIS
reporter-mailx [-v] -d DIR [-c CONFFILE] DESCRIPTION
The tool reads a problem directory, composes an email message from the directory contents, and uses mailx to send the message to specified recipient. Properties of email messages can be specified in a configuration file, and via environment variables. Configuration file Configuration file contains entries in a format "Option = Value". The options are: Subject The subject of the email message. EmailFrom The sender of the email message. EmailTo The recipient of the email message. SendBinaryData Use yes/true/on/1 to attach all binary files from the problem directory to the email. This can cause the emails to be very large. Integration with ABRT events reporter-mailx can be used as a reporter, to allow users report problems via email when they decide to do it. This usage is pre-configured in /etc/libreport/events.d/mailx_event.conf: EVENT=report_Mailx reporter-mailx It can also be used to notify administrator automatically when a problem happens. When this is desired, modify the event configuration file to run the tool on the post-create event: EVENT=post-create reporter-mailx OPTIONS
-d DIR Path to problem directory. -c CONFFILE Path to configuration file. When used in ABRT event system, the file contains site-wide configuration. Users can change the values via environment variables. ENVIRONMENT VARIABLES
Environment variables take precedence over values provided in the configuration file. Mailx_Subject Subject of the email message. Mailx_EmailFrom Sender of the email message. Mailx_EmailTo Recipient of the email message. If nor the environment variable nor the corresponding option is defined, the message is send to "root@localhost". Mailx_SendBinaryData Use yes/true/on/1 to attach all binary files from the problem directory to the email. AUTHORS
o ABRT team LIBREPORT 2.1.11 06/18/2014 REPORTER-MAILX(1)