|Perl Monk, Perl Meditation|
IO::Select & ssh problemby cmv (Chaplain)
|on Sep 17, 2009 at 17:12 UTC||Need Help??|
cmv has asked for the
wisdom of the Perl Monks concerning the following question:
I have the need to tail a bunch of files on remote machines, all at the same time, and print the intermixed lines as they come in (ala xtail). My hands are tied, in that I can't use any perl modules that are not already installed on the existing machine.
Luckily, the current machine has IO::Select, so my current plan is to open file descriptors that are reading the output pipe from the ssh commands, and use select to tell me when there is input on any of them.
I can get this select strategy to work with commands run on the local machine, but anytime I try to ssh that exact same command to a remote machine, I get the following error:
tcsetattr: I/O error
and the ssh connection closes. Attached is my current test script. Any help is very much appreciated!