delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/04/02/13:19:47

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
References: <4610F972 DOT 1030003 AT qualda DOT com>
Subject: RE: Execute "ssh-host-config" from Windows command-line (or from a C program)
Date: Mon, 2 Apr 2007 18:19:09 +0100
Message-ID: <00b301c7754b$067275b0$2e08a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <4610F972.1030003@qualda.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l32HJZ1w017150

On 02 April 2007 13:39, Fabio Román Arbelo wrote:

> Hi!
> 
> I've been trying to launch the "ssh-host-config" from a Windows
> command-line without success. I've been looking Cygwin mailing-list but
> I haven't found anything that solves my problem. For example, I've tried
> this:
> 
>     c:\cygwin\bin> bash -c '"`/bin/ssh-host-config -y -c "ntsec" -p 10000`"'
> 
> And this is what I got:
> 
>     /bin/ssh-host-config: line 110: uname: command not found
>     /bin/ssh-host-config: line 111: expr: command not found
>     /bin/ssh-host-config: line 113: [: -gt: unary operator expected
>     ...
>     /bin/ssh-host-config: line 424: [: -gt: unary operator expected
>     ...
>     WARNING: Adding ssh to   failed!
> 
>     Host configuration finished. Have fun!: No such file or directory


  Right, that's what you'd expect, because the backticks mean "execute this
command, then substitute all the output it generates in place on the command
line".  So you're telling bash to run ssh-host config and then treat all the
messages it outputs as commands to execute!

  Also, because you didn't pass --login to bash, it hasn't run .bashrc or any
of the other things that would set the path, which might account for some of
the 'command not found' problems.

  Also, you just trashed ssh-host-config by using u2d when what was suggested
was in fact d2u.  You'd better go and d2u it now.  Perhaps twice, just to be
on the safe side.  Then try that first command again, but remove the
backticks.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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