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
uuencode(1)						      General Commands Manual						       uuencode(1)

NAME
uuencode, uudecode - Encodes or decodes a binary file SYNOPSIS
uuencode [file] remotefile uudecode [file...] STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: uudecode: XCU5.0 uuencode: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. DESCRIPTION
The uuencode and uudecode commands are used to send a binary file via uucp or other mail. This combination can be used over indirect mail links even when uusend is not available. The uuencode command takes the named file (default standard input) and produces an encoded version on the standard output. The encoding uses only printing ASCII characters, and includes the mode of the file and the name for re-creation on the remote system, specified by remotefile. The uudecode command reads an encoded file, strips off any leading and trailing lines added by mailers, and recreates the original file with the specified mode and name. Filter the encode through the uudecode program. Filtering the file causes the original file to be auto- matically recreated. This is possible on the uucp network by using sendmail or by making rmail be a link to mailx. In each case, an alias must be created in a master file to get the automatic invocation of uudecode. If neither of the preceding facilities is available on a user's system, uudecode can be applied to the file manually by editing the file with any text editor, removing the trailing and leading lines, and changing the mode or remote system name. The encoded file is an ordinary text file. EXAMPLES
In the following example, the ex1 file is encoded; the output is also redirected to the ex1.out file: prompt> uuencode ex1 ex1.en > ex1.out If the source ex1 file is as follows: This example shows how to encode a file using uuencode and how to decode a file using uudecode. The encoded ex1.out file would be as follows: begin 644 ex1.en M5&AI<R!E>&%M<&QE('-H;W=S"G1H92!H;W<@=&@96YC;V1E"F$@9FEL92!U M<VEN9PIU=65N8V]D90IA;F0@:&]W('1O"F1E8V]D92!A(&9I;&4*=7-I;F<@ *=75D96-O9&4N"F]D ` end In the following example, the ex1.out file is decoded: prompt> uudecode ex1.out In this example, the uudecode command decodes the file and puts the output in ex1.en. To package up a source tree using tar, com- press it, uuencode it, and mail it to a user on another system, enter: tar cf - src_tree | compress | uuencode src_tree.tar.Z | mail sys1!sys2!user1 (Enter the command entirely on one line, not on two lines as shown above.) When uudecode is run on the target system, the src_tree.tar.Z file is created; it may then be uncompressed and dearchived with tar. SEE ALSO
Commands: ct(1), cu(1), mailx(1), Mail(1), rmail(1), sendmail(8), tip(1), uucico(8), uucleanup(8), uucp(1), uulog(1), uuname(1), uupick(1), uusched(8), uusend(1), uustat(1), uuto(1), uux(1) Standards: standards(5) uuencode(1)