Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 06-01-2006, 06:47 PM   #1
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 355

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, 09:05 PM   #2
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 355

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

Works fine.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:00 PM
Who-is-calling-Who (bash programming) kaone Programming 2 09-19-2005 11:31 AM
bash script calling mplayer afrodocter Programming 13 08-23-2005 11:41 AM
Calling all bash fans.... jong357 Slackware 2 03-16-2004 08:52 PM
c++ calling bash? adam_boz Programming 4 10-23-2002 01:23 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:14 AM.

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