Re: Expect Script accessing MySQL

2001-09-24 Thread Mikel King

I'm not up on expect, but I would assume that since you can use sh then you
should ber able to use expect.

Generally speaking in sh you can do the following:

#!/bin/sh

MYSQLCMD=/usr/local/bin./mysql
USER=me'
HOST=some.host.com
PASSWD=whatever
QUERY=SELECT userId FROM thisTable WHERE id=1
RESULT='${MYSQLCMD} -h ${HOST}-u ${USERID} -p${PASSWD} -e ${QUERY} -s
thisDB'

echo ${RESULT}

Let me know if you can get expect to work in sh's place...

Cheers,
m!

Chris Aitken wrote:

 At 11:36 PM 23/09/2001, Neil Zanella wrote:

 It is possible and not very hard at all.
 But why would you need expect? Why not
 just use a shell script?

 Because the task I need the script to do is best done using Expect (its
 interfacing with a serial port doing things with some data pulled out of a
 database).

 A psuedo flow of what it does is -

 * Fire off the expect script
 * The expect script grabs fields of data from mysql
 * The expect script uses that data and interfaces with a device hanging off
 a serial port.
 * The script ends with the result based on whether the interaction with the
 serial device succeeds or not.

 Thats why Im wanting to use expect... and thats why I am trying to find a
 way to get mysql data into an expect script.

 Chris

 --
  Chris Aitken - Administration/Database Designer - IDEAL Internet
   email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
   __-__
*** Big Brother ***
 It just shows that the dull will rule the world. And we will be watching it.

 -
 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




Expect Script accessing MySQL

2001-09-23 Thread Chris Aitken

Hi,

Just a quick query. I haven't been able to locate any documentation on it, 
but has anyone ever used an expect script to connect to a MySQL database 
and pull out a bunch of data for use further in the expect script ?

Any directions would be appreciated.



Cheers



Chris
--

 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-
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




Re: Expect Script accessing MySQL

2001-09-23 Thread Neil Zanella


It is possible and not very hard at all.
But why would you need expect? Why not
just use a shell script?

Neil

On Mon, 24 Sep 2001, Chris Aitken wrote:

 Hi,

 Just a quick query. I haven't been able to locate any documentation on it,
 but has anyone ever used an expect script to connect to a MySQL database
 and pull out a bunch of data for use further in the expect script ?

 Any directions would be appreciated.



 Cheers



 Chris
 --

  Chris Aitken - Administration/Database Designer - IDEAL Internet
   email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
   __-__
*** Big Brother ***
 It just shows that the dull will rule the world. And we will be watching it.


 -
 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




Re: Expect Script accessing MySQL

2001-09-23 Thread Chris Aitken

At 11:36 PM 23/09/2001, Neil Zanella wrote:

It is possible and not very hard at all.
But why would you need expect? Why not
just use a shell script?

Because the task I need the script to do is best done using Expect (its 
interfacing with a serial port doing things with some data pulled out of a 
database).

A psuedo flow of what it does is -

* Fire off the expect script
* The expect script grabs fields of data from mysql
* The expect script uses that data and interfaces with a device hanging off 
a serial port.
* The script ends with the result based on whether the interaction with the 
serial device succeeds or not.


Thats why Im wanting to use expect... and thats why I am trying to find a 
way to get mysql data into an expect script.




Chris



--
 Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
  __-__
   *** Big Brother ***
It just shows that the dull will rule the world. And we will be watching it.


-
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