Sponsored Content
Operating Systems AIX How to mail the output of a command in AIX Post 302362910 by Scott on Sunday 18th of October 2009 05:24:50 PM
Old 10-18-2009
Hi.

Code:
df -g | mailx -s "subject" someone@somewhere ...

or

Code:
cat << ! | mailx .....
Here is a report of disk usage:
$(df -g)
!

or

Code:
df -g | uuencode disk_usage.txt | mailx ...

or

Code:
cat << ! | mailx ...
Attached is a report of disk usage.
$(df -g | uuencode disk_usage.txt)
!

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Capturing output from grpck command on AIX

I'm having trouble capturing output from the following command on AIX: grpck -n ALL > error.out It gives me the results on the screen but my file is blank. I have no trouble capturing output from "ls > ls.out", but doesn't seem to work with the grpck command. Any ideas? Thanks. (2 Replies)
Discussion started by: pdtak
2 Replies

2. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

3. UNIX for Dummies Questions & Answers

AIX: mail command & server

Hi, I have to change the mail server, but I could not find the file where it is written in. I use the following command: </> echo krneki | mail -v -s "New report" receiver@our.comp Server name ("skala") can be seen in a terminal output .... receiver@our.comp ... Connecting to... (0 Replies)
Discussion started by: frajer
0 Replies

4. Shell Programming and Scripting

print output of a command in same as shell in mail : please help

i have written a simple script to print the out of a command and send an mail but i am not getting a shell output here .please see my script present output is like this i need an output as same as shell Postfix log summaries for Jan 24 Grand Totals ------------ messages 1432 received 1439... (2 Replies)
Discussion started by: unimaxlin
2 Replies

5. Shell Programming and Scripting

AIX .ksh script freezes when using the mail -s command

Hello I am trying to send an email when a .KSH script is run on an AIX Machine. This email will only include a subject line that is made up of variables from within the script, and is as follows: CURRENT_DATE=`date +%Y%m%d` TIME=`date` ADMIN="myname@domain.com" date block () { ... (4 Replies)
Discussion started by: jimbojames
4 Replies

6. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

7. Shell Programming and Scripting

Redirect script output to a file and mail the output

Hi Guys, I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts. I used below but it is not working: OFILE=/home/home1/report1 echo "report1 details" > $OFILE =/home/home1/1.sh > $OFILE echo... (7 Replies)
Discussion started by: Vivekit82
7 Replies

8. Homework & Coursework Questions

Creating a function that sends a mail using mail command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: The function will be called m and it will allow you to send an email to someone using the mail command. The... (1 Reply)
Discussion started by: Drucian
1 Replies

9. Shell Programming and Scripting

Insert title as output of command to appended file if no output from command

I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place. What I need The following command is placed at the prompt: TICLI... (4 Replies)
Discussion started by: jbrass
4 Replies

10. UNIX for Advanced & Expert Users

Unable to send mail with 'mail' command

I am unable to cause the 'mail' command to send mail from my linux ubuntu 15.10 computer. File 'mail.log' typically reports Connection timed out. I issue the command: mail -s "my subject" recipient@domain.com < filenamewhere filename is a file containing my message. Specifically, the... (3 Replies)
Discussion started by: tcnm
3 Replies
PCRE_COPY_NAMED_SUBSTRING(3)				     Library Functions Manual				      PCRE_COPY_NAMED_SUBSTRING(3)

NAME
PCRE - Perl-compatible regular expressions SYNOPSIS
#include <pcre.h> int pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int buffersize); int pcre16_copy_named_substring(const pcre16 *code, PCRE_SPTR16 subject, int *ovector, int stringcount, PCRE_SPTR16 stringname, PCRE_UCHAR16 *buffer, int buffersize); int pcre32_copy_named_substring(const pcre32 *code, PCRE_SPTR32 subject, int *ovector, int stringcount, PCRE_SPTR32 stringname, PCRE_UCHAR32 *buffer, int buffersize); DESCRIPTION
This is a convenience function for extracting a captured substring, identified by name, into a given buffer. The arguments are: code Pattern that was successfully matched subject Subject that has been successfully matched ovector Offset vector that pcre[16|32]_exec() used stringcount Value returned by pcre[16|32]_exec() stringname Name of the required substring buffer Buffer to receive the string buffersize Size of buffer The yield is the length of the substring, PCRE_ERROR_NOMEMORY if the buffer was too small, or PCRE_ERROR_NOSUBSTRING if the string name is invalid. There is a complete description of the PCRE native API in the pcreapi page and a description of the POSIX API in the pcreposix page. PCRE 8.30 24 June 2012 PCRE_COPY_NAMED_SUBSTRING(3)
All times are GMT -4. The time now is 05:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy