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 - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-21-2007, 08:11 PM   #1
wanghao
Member
 
Registered: Mar 2007
Distribution: centos
Posts: 126

Rep: Reputation: 15
exec the expect command in a shell script


I'm writing a shell script(c style ) for remote issue deal,and i am trying to embed a expect line the shell but don't know how to do .here you see the
shell:
#!/bin/csh
*****command******
#now the expect
expect ? #how to go on
#i hope not write a independent file and here expect -f file ,
#the best is embed all the sentence
*****command*******
Thanks in advance !
 
Old 11-22-2007, 03:36 PM   #2
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
What do you mean by expect command? I've coded several Shell Script and it's a term I am not familiar with. Do you mean a check to see if something exists?
 
Old 11-22-2007, 10:54 PM   #3
wanghao
Member
 
Registered: Mar 2007
Distribution: centos
Posts: 126

Original Poster
Rep: Reputation: 15
at a word ,i need to embed all the expect sentences in the c style script ,
 
Old 11-22-2007, 11:04 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Do you mean that you are using the "/usr/bin/csh" shell?

Maybe this link might help if this is a question on expect:
http://expect.nist.gov/

Last edited by jschiwal; 11-22-2007 at 11:10 PM.
 
Old 11-22-2007, 11:06 PM   #5
wanghao
Member
 
Registered: Mar 2007
Distribution: centos
Posts: 126

Original Poster
Rep: Reputation: 15
yes that is
 
Old 11-23-2007, 05:06 AM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Expect is a scripting language based on TCL. As a matter of fact it is an extension of TCL which provide a few new commands, including the expect command.

Now you could write a minimal script in Expect, call that from Bash and use the return value again in Bash.

Some basic knowledge of TCL is needed when coding in Expect.

The link provided by jschiwal is the correct one which yields the most useful information.

jlinkels
 
Old 11-23-2007, 11:06 PM   #7
wanghao
Member
 
Registered: Mar 2007
Distribution: centos
Posts: 126

Original Poster
Rep: Reputation: 15
Thanks i'll go and have a look .
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
command with shell script sunlinux Programming 2 12-28-2006 11:36 PM
Assistance with 'find -exec cp' shell script dick.swift Linux - Software 6 01-23-2006 10:00 AM
How to combine Expect and Shell script Uday123 Programming 0 12-27-2005 09:01 AM
Command in shell script Grassie Coetzee Linux - Software 1 03-13-2005 11:42 AM
CGI script problem: Send/Expect command echo on webpage rajatgarg Programming 2 07-11-2004 04:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:17 AM.

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