This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Executing ssh from perl

At 3:39 PM -0500 11/18/04, Igor Pechtchanski wrote:
> unfortunately, no change in my results.
BTW: I have ssh configured for passwordless connection.

You *did* properly escape the command string, right? Otherwise,

my $str = `ssh -n user@machine.domain ls`;

will try to interpolate the contents of the array @machine into the
command...  You need to use

my $str = `ssh -n user\@machine.domain ls`;

BTW, the -n flag is still useful, since some commands don't properly run

yep, everything is escaped as needed. I know that by looking at the debug output:
debug1: Sending command: ls <path to file I care about>

I've also printed the command to stdout and pasted it into a windows cmd shell and cygwin terminal with success.

If I use system("<cmd>"); instead of `<cmd>`;, the command returns 0, (no hang). Unfortunately system wont work for my needs, as it is critical I evaluate stdout:stderr.

I do appreciate your help.

-- Unsubscribe info: Problem reports: Documentation: FAQ:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]