I have to run multiple command about 20x on linux each one got his own output, I want to bind all the out puts of them in one file then read this file and mail it to user account
sample
[root@imail pons]# /home/pons/tsmmonitor stgpool SDC-STAFF stgpool - utilization of storage pool SDC-STAFF 62%, OK [root@imail pons]# /home/pons/tsmmonitor stgpool ISO-BACKUP-POOL stgpool - utilization of storage pool ISO-BACKUP-POOL 41%, OK [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK
I want all these out puts be bind it in one file
myfile:
stgpool - utilization of storage pool SDC-STAFF 62%, OK stgpool - utilization of storage pool ISO-BACKUP-POOL 41%, OK stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK
then to read this file and send it to email address
Thanks
Hi Mad Unix,
On Sun, Feb 8, 2009 at 09:06, Mad Unix madunix@gmail.com wrote:
I have to run multiple command about 20x on linux each one got his own output,
It is not the first time you come to the list with questions about shell scripting, and most of them very basic. So, what I really recommend for you now is this: http://letmegooglethatforyou.com/?q=learn+shell+script
I want to bind all the out puts of them in one file
Read my previous post about using redirection more efficiently: http://lists.centos.org/pipermail/centos/2009-February/071813.html
then read this file and mail it to user account
man mail
You will only learn if you try. If you really try and it still does not work as you expect, and you have more specific questions, please post them to the list. When you do, please use more specific subjects.
HTH, Filipe
resolved.
On Sun, Feb 8, 2009 at 4:33 PM, Filipe Brandenburger filbranden@gmail.com wrote:
Hi Mad Unix,
On Sun, Feb 8, 2009 at 09:06, Mad Unix madunix@gmail.com wrote:
I have to run multiple command about 20x on linux each one got his own output,
It is not the first time you come to the list with questions about shell scripting, and most of them very basic. So, what I really recommend for you now is this: http://letmegooglethatforyou.com/?q=learn+shell+script
I want to bind all the out puts of them in one file
Read my previous post about using redirection more efficiently: http://lists.centos.org/pipermail/centos/2009-February/071813.html
then read this file and mail it to user account
man mail
You will only learn if you try. If you really try and it still does not work as you expect, and you have more specific questions, please post them to the list. When you do, please use more specific subjects.
HTH, Filipe _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Mad Unix wrote:
I have to run multiple command about 20x on linux each one got his own output, I want to bind all the out puts of them in one file then read this file and mail it to user account
sample
[root@imail pons]# /home/pons/tsmmonitor stgpool SDC-STAFF stgpool - utilization of storage pool SDC-STAFF 62%, OK [root@imail pons]# /home/pons/tsmmonitor stgpool ISO-BACKUP-POOL stgpool - utilization of storage pool ISO-BACKUP-POOL 41%, OK [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK
I want all these out puts be bind it in one file
myfile:
stgpool - utilization of storage pool SDC-STAFF 62%, OK stgpool - utilization of storage pool ISO-BACKUP-POOL 41%, OK stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK
then to read this file and send it to email address
Thanks _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Hi,
Do this by re-directing the output from your commands into a file like this:
[root@imail pons]# /home/pons/tsmmonitor stgpool SDC-STAFF > outfile
[root@imail pons]# /home/pons/tsmmonitor stgpool ISO-BACKUP-POOL >> outfile
[root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL >>outfile
[root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL >>outfile
Note that the single ">" in the first line will create a new "outfile" that is it will create the file if it does not exist or over-write it if it does exist.
The double ">>" in the following commands will append the output of those commands to the already existing "outfile".
ChrisG
On Sun, Feb 8, 2009 at 9:52 AM, Chris Geldenhuis chris.gelden@iafrica.comwrote:
Mad Unix wrote:
I have to run multiple command about 20x on linux each one got his own output, I want to bind all the out puts of them in one file then read this file and mail it to user account
sample
[root@imail pons]# /home/pons/tsmmonitor stgpool SDC-STAFF stgpool - utilization of storage pool SDC-STAFF 62%, OK [root@imail pons]# /home/pons/tsmmonitor stgpool ISO-BACKUP-POOL stgpool - utilization of storage pool ISO-BACKUP-POOL 41%, OK [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK
I want all these out puts be bind it in one file
myfile:
stgpool - utilization of storage pool SDC-STAFF 62%, OK stgpool - utilization of storage pool ISO-BACKUP-POOL 41%, OK stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK
then to read this file and send it to email address
Thanks _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Hi,
Do this by re-directing the output from your commands into a file like this:
[root@imail pons]# /home/pons/tsmmonitor stgpool SDC-STAFF > outfile
[root@imail pons]# /home/pons/tsmmonitor stgpool ISO-BACKUP-POOL >> outfile
[root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL
outfile
[root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL
outfile
Note that the single ">" in the first line will create a new "outfile" that is it will create the file if it does not exist or over-write it if it does exist.
The double ">>" in the following commands will append the output of those commands to the already existing "outfile".
ChrisG
Actually ">>" will also create the file if it doesn't exit. Try it :)
-matt http://www.sysadminvalley.com http://www.beantownhost.com http://www.linkedin.com/in/mattboston Joe E. Lewis - "I distrust camels, and anyone else who can go a week without a drink."
Matt Shields wrote:
On Sun, Feb 8, 2009 at 9:52 AM, Chris Geldenhuis <chris.gelden@iafrica.com mailto:chris.gelden@iafrica.com> wrote:
Mad Unix wrote: > I have to run multiple command about 20x on linux each one got his > own output, I want to bind all the out puts of them in one file then > read this file and mail it to user account > > sample > > [root@imail pons]# /home/pons/tsmmonitor stgpool SDC-STAFF > stgpool - utilization of storage pool SDC-STAFF 62%, OK > [root@imail pons]# /home/pons/tsmmonitor stgpool ISO-BACKUP-POOL > stgpool - utilization of storage pool ISO-BACKUP-POOL 41%, OK > [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL > stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK > [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL > stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK > > I want all these out puts be bind it in one file > > myfile: > > stgpool - utilization of storage pool SDC-STAFF 62%, OK > stgpool - utilization of storage pool ISO-BACKUP-POOL 41%, OK > stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK > stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK > > then to read this file and send it to email address > > Thanks > _______________________________________________ > CentOS mailing list > CentOS@centos.org <mailto:CentOS@centos.org> > http://lists.centos.org/mailman/listinfo/centos > > Hi, Do this by re-directing the output from your commands into a file like this: [root@imail pons]# /home/pons/tsmmonitor stgpool SDC-STAFF > outfile [root@imail pons]# /home/pons/tsmmonitor stgpool ISO-BACKUP-POOL >> outfile [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL >>outfile [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL >>outfile Note that the single ">" in the first line will create a new "outfile" that is it will create the file if it does not exist or over-write it if it does exist. The double ">>" in the following commands will append the output of those commands to the already existing "outfile". ChrisG
Actually ">>" will also create the file if it doesn't exit. Try it :)
-matt http://www.sysadminvalley.com http://www.beantownhost.com http://www.linkedin.com/in/mattboston Joe E. Lewis - "I distrust camels, and anyone else who can go a week without a drink."
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Hi Matt,
I know that, but if you use >> and there is some file there with that name already the data will be appended to it instead of starting a new file with the output of your current session only.
ChrisG
On Sun, Feb 8, 2009 at 10:02 AM, Chris Geldenhuis chris.gelden@iafrica.comwrote:
Matt Shields wrote:
On Sun, Feb 8, 2009 at 9:52 AM, Chris Geldenhuis <chris.gelden@iafrica.com mailto:chris.gelden@iafrica.com> wrote:
Mad Unix wrote: > I have to run multiple command about 20x on linux each one got his > own output, I want to bind all the out puts of them in one file
then
> read this file and mail it to user account > > sample > > [root@imail pons]# /home/pons/tsmmonitor stgpool SDC-STAFF > stgpool - utilization of storage pool SDC-STAFF 62%, OK > [root@imail pons]# /home/pons/tsmmonitor stgpool ISO-BACKUP-POOL > stgpool - utilization of storage pool ISO-BACKUP-POOL 41%, OK > [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL > stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK > [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL > stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK > > I want all these out puts be bind it in one file > > myfile: > > stgpool - utilization of storage pool SDC-STAFF 62%, OK > stgpool - utilization of storage pool ISO-BACKUP-POOL 41%, OK > stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK > stgpool - utilization of storage pool ORACLE-DUMP-POOL 62%, OK > > then to read this file and send it to email address > > Thanks > _______________________________________________ > CentOS mailing list > CentOS@centos.org <mailto:CentOS@centos.org> > http://lists.centos.org/mailman/listinfo/centos > > Hi, Do this by re-directing the output from your commands into a file like this: [root@imail pons]# /home/pons/tsmmonitor stgpool SDC-STAFF > outfile [root@imail pons]# /home/pons/tsmmonitor stgpool ISO-BACKUP-POOL >> outfile [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL >>outfile [root@imail pons]# /home/pons/tsmmonitor stgpool ORACLE-DUMP-POOL >>outfile Note that the single ">" in the first line will create a new
"outfile"
that is it will create the file if it does not exist or over-write it if it does exist. The double ">>" in the following commands will append the output of those commands to the already existing "outfile". ChrisG
Actually ">>" will also create the file if it doesn't exit. Try it :)
-matt http://www.sysadminvalley.com http://www.beantownhost.com http://www.linkedin.com/in/mattboston Joe E. Lewis - "I distrust camels, and anyone else who can go a week without a drink."
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Hi Matt,
I know that, but if you use >> and there is some file there with that name already the data will be appended to it instead of starting a new file with the output of your current session only.
ChrisG
For some that might be what they want. :)
-matt http://www.sysadminvalley.com http://www.beantownhost.com http://www.linkedin.com/in/mattboston Charles M. Schulz - "I love mankind; it's people I can't stand."
You want this and I want a grapefruit. Thanks for you attitude.
Kai