Hi :
I try it but could not get it to work. Here is part of my scripts:
exp_internal -f error_file.txt 0
spawn bash
expect "*$ "
send "/cygdrive/c/mysql/bin/mysql -u root -p test\r"
expect "Enter password:"
send "\r"
expect "*mysql>"
spawn bash
parent: waiting for sync byte
parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {2544}
expect: does "" (spawn_id 5) match glob pattern "*$ "? no
]0;/cygdrive/c/mysql/bin
[32mAdministrator@VAN-PCHOY [33m/cygdrive/c/mysql/bin[0m
$
expect: does "\x1b]0;/cygdrive/c/mysql/bin\x07\r\n\x1b[32mAdministrator@VAN-PCHOY
\x1b[33m/cygdrive/c/mysql/bin\x1b[0m\r\n$ " (spawn_id 5) match glob pattern "*$ "? yes
expect: set expect_out(0,string)
"\x1b]0;/cygdrive/c/mysql/bin\x07\r\n\x1b[32mAdministrator@VAN-PCHOY
\x1b[33m/cygdrive/c/mysql/bin\x1b[0m\r\n$ "
expect: set expect_out(spawn_id) "5"
expect: set expect_out(buffer)
"\x1b]0;/cygdrive/c/mysql/bin\x07\r\n\x1b[32mAdministrator@VAN-PCHOY
\x1b[33m/cygdrive/c/mysql/bin\x1b[0m\r\n$ "
send: sending "/cygdrive/c/mysql/bin/mysql -u root -p test\r" to { 5 }
expect: does "" (spawn_id 5) match glob pattern "Enter password:"? no
/cygdrive/c
expect: does "/cygdrive/c" (spawn_id 5) match glob pattern "Enter password:"? no
/mysq
expect: does "/cygdrive/c/mysq" (spawn_id 5) match glob pattern "Enter password:"? no
l/bi
expect: does "/cygdrive/c/mysql/bi" (spawn_id 5) match glob pattern "Enter password:"?
no
n/mys
expect: does "/cygdrive/c/mysql/bin/mys" (spawn_id 5) match glob pattern "Enter
password:"? no
ql -
expect: does "/cygdrive/c/mysql/bin/mysql -" (spawn_id 5) match glob pattern "Enter
password:"? no
u roo
expect: does "/cygdrive/c/mysql/bin/mysql -u roo" (spawn_id 5) match glob pattern
"Enter password:"? no
t -p
expect: does "/cygdrive/c/mysql/bin/mysql -u root -p" (spawn_id 5) match glob pattern
"Enter password:"? no
test
expect: does "/cygdrive/c/mysql/bin/mysql -u root -p test" (spawn_id 5) match glob
pattern "Enter password:"? no
expect: does "/cygdrive/c/mysql/bin/mysql -u root -p test\r\n" (spawn_id 5) match glob
pattern "Enter password:"? no
expect: timed out
send: sending "\r" to { 5 }
expect: does "/cygdrive/c/mysql/bin/mysql -u root -p test\r\n" (spawn_id 5) match glob
pattern "*mysql>"? no
expect: does "/cygdrive/c/mysql/bin/mysql -u root -p test\r\n\r\n" (spawn_id 5) match
glob pattern "*mysql>"? no
expect: timed out
-----Original Message-----
From: Cindy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 5:01 PM
To: [EMAIL PROTECTED]
Subject: Re: Can Expect scripts interact with mysql ?
"Paul Choy" writes:
>Hi :
>
>I am trying to run Expect scripts to interact with mysql. So far I cannot get
> it to work here is the list of log I got.Does anyone know how to interact Ex
>pect scripts with mysql. What am I missing ?
I've done it, but I don't spawn directly. I spawn a regular shell
and then just send out the command to start it, eg
# start up command line interface to mysql
send "/usr/local/mysql/bin/mysql -u root -p $dbname\r"
and go on from there. Works just fine.
--Cindy
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php