in reply to capture output and email on linux
The default behavior of rsh (or ssh) is to attach the remote process's STDOUT to the local process STDOUT (in this case, the STDOUT of the shell being spawned by "system()"), so you can pipe the output of the rsh'ed command to some other (local) process on the same command line.my $recipient = "somebody@somewhere.dom"; while (<IN>) { chomp; system( "rsh $_ snapmirror status | mail $recipient" ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: capture output and email on linux
by JSchmitz (Canon) on Jun 09, 2005 at 18:57 UTC |