ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Eugene Prokopiev <prokopiev@stc.donpac.ru>
To: ALT Linux Community <community@lists.altlinux.org>
Subject: Re: [Comm] Expect
Date: Thu, 23 Nov 2006 12:35:50 +0300
Message-ID: <45656B76.1000808@stc.donpac.ru> (raw)
In-Reply-To: <1164215551.12822.1.camel@localhost>

И все равно не понимаю:

expect {
   "Welcome to MT800" {
     expect {
       "login: "    { send "$username\r" }
     }
     expect {
       "password: " { send "$password\r" }
     }

     for {set i 1} {$i<7} {incr i} {
         send_user "i = $i\n"
         expect {
           "\\$"   { send "delete bridge port intf ifname eoa-$i\r" }
         }
     }

     expect {
       "\\$"  { send "exit\r" }
     }
     expect eof
   }
}

На выводе получается жуткая мешанина:

login: admin
password: i = 1

Login Successful
$i = 2
delete bridge port intf ifname eoa-1
Error: Entry does not exist
$i = 3
delete bridge port intf ifname eoa-2

Entry Deleted
$i = 4
delete bridge port intf ifname eoa-3
Error: Entry does not exist
$i = 5
delete bridge port intf ifname eoa-4

Entry Deleted
$i = 6
delete bridge port intf ifname eoa-5
Error: Entry does not exist
$delete bridge port intf ifname eoa-6

Entry Deleted
$exit
Connection closed by foreign host.

Такое ощущение, что все операторы работают параллельно. А то, что иногда 
получается, так это случайность :(

-- 
С уважением, Прокопьев Евгений



      parent reply	other threads:[~2006-11-23  9:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-22 12:22 Eugene Prokopiev
2006-11-22 17:12 ` Peter Volkov
2006-11-22 17:59   ` Eugene Prokopiev
2006-11-23  7:23   ` Eugene Prokopiev
2006-11-23  7:58   ` Eugene Prokopiev
2006-11-23  8:25   ` Eugene Prokopiev
2006-11-23  9:35   ` Eugene Prokopiev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45656B76.1000808@stc.donpac.ru \
    --to=prokopiev@stc.donpac.ru \
    --cc=community@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git