LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-01-2003, 05:58 PM   #1
rkeng
LQ Newbie
 
Registered: Aug 2003
Posts: 1

Rep: Reputation: 0
Unhappy Using Expect for Linux


How do I use Expect to send and receive strings for a serial
device connected to /dev/ttyS0?

I'm using Red Hat 7.5 running
on a Pentium IV based machine.
 
Old 08-01-2003, 08:45 PM   #2
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
You are going to have a very hard time unless the strings that are sent/received are always constant. If it is a completely static format kind of give and take (like FTP, <suppress verbose>, cd <dir>, mget *, exit would be) , then autoexpect.

autoexpect
do all the commands, example, telnet, ssh, ftp, etc
exit

script created called script.exp. It will do, and EXPECT everything you just did.

RO

man autoexpect
and google on autoexpect
 
Old 08-01-2003, 09:01 PM   #3
slapNUT
Member
 
Registered: Jun 2001
Location: Recycle Bin
Distribution: Linux & Everything else on VirtualBox
Posts: 144

Rep: Reputation: 15
There are a lot of examples here, maybe one will help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use expect TomCruise2002 Linux - General 2 04-09-2017 08:00 AM
Expect how to? e-freak Programming 2 09-24-2005 04:49 AM
I'm thinking of trying Linux... What should I expect? Using Lindows4.0 lovaslane Linux - Newbie 52 04-10-2004 04:03 PM
help with expect neyoung Programming 3 02-09-2004 09:41 PM
expect sk8guitar Programming 3 07-29-2003 09:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration