<div class="gmail_quote">On Sun, Feb 8, 2009 at 9:52 AM, Chris Geldenhuis <span dir="ltr"><<a href="mailto:chris.gelden@iafrica.com">chris.gelden@iafrica.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">Mad Unix wrote:<br>
> I have to run multiple  command about 20x on linux each one got his<br>
> own output, I want to bind all the out puts of them in one file then<br>
> read this file and mail it to user account<br>
><br>
> sample<br>
><br>
> [root@imail pons]# /home/pons/tsmmonitor stgpool SDC-STAFF<br>
> stgpool - utilization of storage pool SDC-STAFF 62%, OK<br>
> [root@imail pons]# /home/pons/tsmmonitor stgpool ISO-BACKUP-POOL<br>
> stgpool - utilization of storage pool ISO-BACKUP-POOL 41%, OK<br>
> [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL<br>
> stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK<br>
> [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL<br>
> stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK<br>
><br>
> I want all these out puts be bind it in one file<br>
><br>
> myfile:<br>
><br>
> stgpool - utilization of storage pool SDC-STAFF 62%, OK<br>
> stgpool - utilization of storage pool ISO-BACKUP-POOL 41%, OK<br>
> stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK<br>
> stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK<br>
><br>
> then to read this file and send it to email address<br>
><br>
> Thanks<br>
> _______________________________________________<br>
> CentOS mailing list<br>
> <a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
> <a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
><br>
><br>
</div></div>Hi,<br>
<br>
Do this by re-directing the output from your commands into a file like this:<br>
<br>
[root@imail pons]# /home/pons/tsmmonitor stgpool SDC-STAFF > outfile<br>
<br>
[root@imail pons]# /home/pons/tsmmonitor stgpool ISO-BACKUP-POOL >> outfile<br>
<br>
[root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL >>outfile<br>
<br>
[root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL >>outfile<br>
<br>
Note that the single ">" in the first line will create a new "outfile"<br>
that is it will create the file if it does not exist or over-write it if<br>
it does exist.<br>
<br>
The double ">>" in the following commands will append the output of<br>
those commands to the already existing "outfile".<br>
<br>
ChrisG<br>
<div><div></div><div class="Wj3C7c"><br>
</div></div></blockquote><div> <br>Actually ">>" will also create the file if it doesn't exit.  Try it :)<br><br clear="all">-matt<br><a href="http://www.sysadminvalley.com">http://www.sysadminvalley.com</a><br>
<a href="http://www.beantownhost.com">http://www.beantownhost.com</a><br><a href="http://www.linkedin.com/in/mattboston">http://www.linkedin.com/in/mattboston</a><br>Joe E. Lewis  - "I distrust camels, and anyone else who can go a week without a drink."
<br><br></div></div>