How to telnet to other unix machines and grep log files etc?

Quinn Dunkan quinn at
Wed Jul 25 13:22:12 EDT 2001

On 25 Jul 2001 08:42:44 -0700, Chris <bit_bucket5 at> wrote:
>Relative unix newbie.  Would like to write a python script to do what
>I do manually--telnet to two different unix machines from a third unix
>machine.  Grep through some log files, gather the grep results from
>the different machines and spit them out.  I think I need to do
>something with popen, or popen2, or ???  I don't know where to start. 
>Any pointers much appreciated.

This is a shell task:

(ssh machine1 'grep foo /sys/log/bar';
 ssh machine2 'grep baz /sys/log/faz') >results

Create an RSA key with no passphrase if you don't want to have to type
passwords all the time.

More information about the Python-list mailing list