Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Thu, 18 Nov 2004 16:30:20 -0500 (EST) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Stephen Studley cc: cygwin AT cygwin DOT com Subject: Re: Executing ssh from perl In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.39 On Thu, 18 Nov 2004, Stephen Studley wrote: > 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 AT machine DOT 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 > > otherwise. > > yep, everything is escaped as needed. I know that by looking at the debug > output: > debug1: Sending command: ls > > 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(""); instead of ``;, 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. > Stephen I suppose the next step is to try to reproduce this in a command-line perl invocation, e.g., something like perl -we 'my $str=`ssh -n user\@machine.domain ls`;print "[$str]\n"' and see what messages that produces. I assume it's working for you from a Linux machine... Also, I don't believe you've said anything about your system configuration -- please review and provide the requested information. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "The Sun will pass between the Earth and the Moon tonight for a total Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/