LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-01-2006, 05:47 PM   #1
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Rep: Reputation: 30
Trouble calling 'expect' from bash


I have written a small expect script which I want to call from
another bash script. I have set up the bash script to call the
expect script like this:
#! /bin/bash
..
..
. /usr/local/bin/expect-script
..
..

Unfortunately, I keep getting the error message:

"spawn: command not found, couldn't read file "Password:" " etc.

The expect script works perfectly when initiated from the
command line, so somehow trying to call it from a bash script
is causing a problem. I suspect that the initiating line
#! /usr/bin/expect in the expect script is not being executed
properly to call the expect program.

I have tried to include the expect statements in the bash script but
get the same or similar message. I somehow need to invoke 'expect'
and input these commands from bash.

Is there a way to do this?
 
Old 06-01-2006, 08:05 PM   #2
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Original Poster
Rep: Reputation: 30
I see the mistake; shouldn't have called the expect as source.

Works fine.
 
  


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
expect/bash sk8guitar Programming 5 10-06-2009 12:00 PM
Who-is-calling-Who (bash programming) kaone Programming 2 09-19-2005 10:31 AM
bash script calling mplayer afrodocter Programming 13 08-23-2005 10:41 AM
Calling all bash fans.... jong357 Slackware 2 03-16-2004 07:52 PM
c++ calling bash? adam_boz Programming 4 10-23-2002 12:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:55 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