how to send the output


 
Thread Tools Search this Thread
Operating Systems Solaris how to send the output
# 1  
Old 02-13-2009
how to send the output

Hi,
how to send the output of a command directly to a file. For eg: am issuing metastat -a. How to send the output of this command to a file as well as mail.
rogerben
# 2  
Old 02-13-2009
to a file
Code:
mycommand > newfile

to email
Code:
mycommand | /usr/bin/mailx -s 'output of mycommand'  me@my.com

# 3  
Old 02-13-2009
Quote:
Originally Posted by jim mcnamara
to a file
Code:
mycommand > newfile

to email
Code:
mycommand | /usr/bin/mailx -s 'output of mycommand'  me@my.com


thanks a lot for your timely reply.
rogerben
# 4  
Old 02-13-2009
or do it in one shot

Code:
metastat -a|tee myfile.log |mailx foo@bar.com

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I want query output to send on mail using table tag and output should be in table

#! /bin/ksh #] && . ./.profile 2>/dev/null if test -f '.profile'; then . ./.profile; fi; #. .profile LOG_DIR=/app/rpx/jobs/scripts/just/logs sendEmail() { pzCType="$1"; pzTitle="$2"; pzMsg="$3"; pzFrom="$4"; pzTo="$5"; pzFiles="$6"; pzReplyTo="$7" ( ... (21 Replies)
Discussion started by: ankit.mca.aaidu
21 Replies

2. Shell Programming and Scripting

Send email if Output is available

hello can anyone debug these lines cd /usr/local/scripts ./build update ./build versions | grep available if then mail -s "update for server `hostname`" $EMAIL else echo -e "$YELLOW No update $RESET" fi echo "Please press a key - Back to main menu . . ." ; read but... (3 Replies)
Discussion started by: nimafire
3 Replies

3. Shell Programming and Scripting

Send output of a command as an email

Hello Unix Experts! We are on AIX 6.1 TL6 I am trying to develop a script that does the following: It should send the output of "df -g /directory/folder" command as an email to a user(someone@company.com) This is too simple and i can research on how to do it, but it would be great if... (2 Replies)
Discussion started by: atechcorp
2 Replies

4. Shell Programming and Scripting

want to send 4 files output in one mail

Hi All , i have a wrapper HTML script -FS_CHECK_HTML_SCIPT_WT_Statusbar.sh which read a TXT file (script_KB.txt) and sends output to a mail in tabular format. TXT file is having 6 columns and so wrapper script create a table with 6 columns and supplies those 6 columns data from TXT file .... (2 Replies)
Discussion started by: deepakiniimt
2 Replies

5. UNIX for Advanced & Expert Users

Output will send in mail

Hi All, Requirement is to select the data from database and send the output in mail. But the output should in HTML tabular format in mail body. For example my select command is : select ename,esal,edegn,dept from emp where deptno in (10,15); In the mail body the output should : Employee... (3 Replies)
Discussion started by: alex_us
3 Replies

6. Programming

C system() how to send the output to an array??

Hi, im in need if wisdom here guys... How could I store the output of commands like ping integrally directly into a array??? I'll be using system() to run the commands but how can I send the output to an array??? cuz I need to store it so that I can later copy the array's content to a buffer... (5 Replies)
Discussion started by: Jess83
5 Replies

7. Solaris

Send cut output to basename

Hi, I'm running a command : pargs 20392 | egrep -e "-f "|cut -d " " -f3 | basename BUT the o/p of cut is not sending to basename. the o/p of: pargs 20392 | egrep -e "-f "|cut -d " " -f3 is /home/staff/Properties.cfg Appreciated ur help.. (2 Replies)
Discussion started by: axes
2 Replies

8. Shell Programming and Scripting

send an email of script output

Hi All, I'm trying to send some file which generated by script to my email. when I run the script I'm getting an email. Thats fine. But it seems to be all messed up like below Memory Status on ServerA: Mem: 3867444k total, 862680k used, 3004764k free, 54456k buffers!! CPU Status on ServerA:... (4 Replies)
Discussion started by: s_linux
4 Replies

9. Shell Programming and Scripting

Compare 2 files and send output to other

Hi, In File1.txt I have text like: 23AA3424DD23|3423ff25sd5345| and so on In File2.txt I have similar text as File1, but with ",": 23aa3424dd23,192.168.1.100, and so on I wan to remove the pipes from File1 and select 5 fields, then remove "," from File2.txt and select 2 fields (IP's... (14 Replies)
Discussion started by: cameleon
14 Replies

10. Shell Programming and Scripting

Send output of .SH to a function

Hello All, I am new to Shell script world. Please help me out with following query.. OS: AIX Shell Script I am trying to execute: showStatus () { echo $1 //Actually I need to do something with the input here... } ./serverStatus.sh | grep STARTED | awk '{print $5}' | showStatus... (3 Replies)
Discussion started by: raj_uk
3 Replies
Login or Register to Ask a Question