[ILUG] SSH output and perl.

Braun Brelin bbrelin at gmail.com
Fri Jan 13 14:28:21 GMT 2012


Hello all,

A quick question for the list.
How do I capture stdout from a backquoted SSH command  in perl?

For example:

$Foo=`ssh myhost 'ls  /tmp/bar`;

I want $Foo to contain the ls output or "file not found"  error string. I
tried ssh  -n but that didn't help.

Thanks


More information about the ILUG mailing list