delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/06/12:21:30

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Reply-To: Cygwin List <cygwin AT cygwin DOT com>
Message-Id: <6.1.0.6.0.20040806122058.033978a0@pop.prospeed.net>
X-Sender:
Date: Fri, 06 Aug 2004 12:21:41 -0400
To: "David E. Meier" <dev AT eth0 DOT ch>, "Cygwin List" <cygwin AT cygwin DOT com>
From: Larry Hall <lh-no-personal-replies-please AT cygwin DOT com>
Subject: Re: Redirect stdout from SSH
In-Reply-To: <4377.217.162.71.141.1091808058.squirrel@217.162.71.141>
References: <1614 DOT 217 DOT 162 DOT 71 DOT 141 DOT 1091552632 DOT squirrel AT 217 DOT 162 DOT 71 DOT 141> <6 DOT 1 DOT 0 DOT 6 DOT 0 DOT 20040803172459 DOT 0338a528 AT pop DOT prospeed DOT net> <3552 DOT 217 DOT 162 DOT 71 DOT 141 DOT 1091799815 DOT squirrel AT 217 DOT 162 DOT 71 DOT 141> <6 DOT 1 DOT 0 DOT 6 DOT 0 DOT 20040806105531 DOT 033469a0 AT pop DOT prospeed DOT net> <4377 DOT 217 DOT 162 DOT 71 DOT 141 DOT 1091808058 DOT squirrel AT 217 DOT 162 DOT 71 DOT 141>
Mime-Version: 1.0

At 12:00 PM 8/6/2004, you wrote:
>OK, short overview: I am working on a program in C# that needs to run some
>commands on a remote machine and therefore I use SSH. The output will then
>be written into a textbox. In C# you can run a command like this:
>
>Process MyProcess = new Process();
>ProcessStartInfo psi = new ProcessStartInfo();
>psi.FileName = @"c:\cygwin\bin\ls";
>psi.Arguments = "-al";
>psi.UseShellExecute = false;
>psi.RedirectStandardError = true;
>psi.RedirectStandardOutput = true;
>psi.CreateNoWindow = true;
>MyProcess.StartInfo = psi;
>MyProcess.Start();
>+ textbox handling stuff.
>
>This command will run 'ls' without creating the Command Window and outputs
>the the listing of the direcotry as expected in the textbox. Now, when I
>want to invoke SSH in the same manner, setting these values:
>
>psi.FileName = @"c:\cygwin\bin\ssh";
>psi.Arguments = "-i /path/to/key user AT host ls -al";
>
>then I have to explicitly set
>
>psi.RedirectStandardInput = true;
>
>or else it won't work. Although I see the command executing by observing
>some network action there is nothing returned to the textbox and CPU stays
>at 100%. There is nothing that needs to be written to stdin such as a
>passphrase or so. However, programs using SSH, such as rsync, don't need
>to set RedirectStandardInput = true to write their output to the textbox.
>I just wonder what's the difference.

That I can't say.


--
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746                     


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019