delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/30/14:23:41

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Wed, 30 May 2001 14:22:29 -0400
From: "Simha, Shuba" <shuba_simha AT merck DOT com>
Subject: Calling SSH from Expect - URGENT
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Message-id: <A33B09832F4CD411974400508BCF8F2B03438517@uswsmx18.merck.com>
MIME-version: 1.0

Hi Cygwin users,

I am using Expect-5.26 from Cygwin-1.3.1
I am trying to connect to a remote host through SSH, & on the command line,
it works just perfect. But when I write an "Expect" script for the same, it
does not do anything.

Here is the comand I use:
	/bin/ssh -l username -p port hostname.abc.com "ls -l"
It prompts for the passphrase, & when I enter it, it neatly lists the
contents of my home dir. (username, port & hostname.abc.com actually have
real values)
 
The Expect code fragment is below:

#!/usr/bin/expect
spawn /bin/ssh -l username -p port hostname.abc.com "ls -l" 
expect -re "Enter passphrase for RSA key '.*': " 
send "passphrase\r" 
expect eof

This however does not list anything, though it takes the passphrase.. (I can
see the passphrase being echoed on the screen)
More surprisingly, as soon as the script ends, the monitor will go out of
echo mode(I cannot see what I type!!)

The same happens when I try SCP as well.

Can anybody tell me whats wrong with what I am doing? 

Thanks a lot on advance..
-Shuba


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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