[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interactive Expect from bash Script

From: Esben Stien
Subject: Re: Interactive Expect from bash Script
Date: Sat, 29 Mar 2014 21:32:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Andreas Schwab <address@hidden> writes:

> Please define "outside the bash script".

If I run this, it works: 


set passwd [lindex $argv 1]
set password passwd
spawn /usr/bin/ssh [lindex $argv address@hidden $argv 2]
expect {
    -re ".*Are.*.*yes.*no.*" {
        send "yes\n"
        #look for the password prompt

    "*?assword:*" {
        send $passwd
        send "\n"
        #The expect command will now return

> Since you are passing the expect script on stdin the interact command
> will immediately read EOF, and expect will run into its implicit
> timeout.

Hmm, I see, so how am I supposed to run it?;)

Esben Stien is address@hidden     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n

reply via email to

[Prev in Thread] Current Thread [Next in Thread]