ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This is my first post to this forum. Iam not quite sure iam in the right location to post my query in this forum.
Can anyone guide me what exactly is the Expect Utility. Iam a very new user to linux.
Can we use this expect utility to write and run scripts? Is it like a telnet client with WAIT, SEND and SLEEP commands?
What does the expect Utility exactly do? Does if have conditional statements. How to install and start this utility?
BACKGROUND:
Iam using BDI2000 JTAG tool for debugging my target boards. The CLI prompt for the BDI tool is accessed via telnet.
At this prompt, if the JTAG connection is succesfully then via telnet, the config files for reqd target board are loaded. BDI provides a telnet server which has to be enabled prior to this.
Now once the config files are taken, we get the processor prompt on the BDI CLI.
Its here that I want to write scripts for checking various hardware sections of my target board. For this...I was wondering if i could use the Expect utility.
For example if i want to test the datalines of my SDRAM(memory)
Want i would like to do is... write some data(hex) into a certain memory location and read it back. if its the same as the data written, then i could assume the datalines of the memory is fine. but if the data recieved is not the same, then i need need to convert this data into a binary and find out which is the dataline causing the problem.
Can anyone help me... how i could do this using the expect script. how do we run a expect script?
Essentially, the answer to your question is "yes", for more details, there is a long man page for expect:
Quote:
INTRODUCTION
Expect is a program that "talks" to other interactive programs accord-
ing to a script. Following the script, Expect knows what can be
expected from a program and what the correct response should be. An
interpreted language provides branching and high-level control struc-
tures to direct the dialogue. In addition, the user can take control
and interact directly when desired, afterward returning control to the
script.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.