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 - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-05-2002, 08:08 PM   #1
104625
LQ Newbie
 
Registered: May 2002
Posts: 8

Rep: Reputation: 0
Angry using Except & Spawin in scripts


Ok this is really probably an easy one to solve but I am struggling. I am writing a script that will spawn a few terminal sessions and will telnet to a server. Now to do that I was going to use the Except, spawn, send, etc commands. I have installed the Except RPM (I am using redhat 7.2 kernel 2.4.7-10). I have included the header in the script #! /usr/bin/except. When I try to run the script it just out puts the line of code "spawn telnet." But if I have any shell commands such as echo or clear, it reports and error (commands not found). When I use the #! /bin/sh as the header it reports that spawn cannot be found. If anyone can suggest anything please do.
Thanking you in advance
 
Old 05-06-2002, 06:47 PM   #2
rcgroups1
LQ Newbie
 
Registered: Apr 2002
Location: USA
Distribution: RedHat/Suse/Mandrake
Posts: 18

Rep: Reputation: 0
I think you misspelled expect . I had kinda same issue. was giving me errors for unknows problem. I just reinstalled expect of different version and now it workd great. I hope it helps you
 
Old 05-07-2002, 02:04 PM   #3
twintip
LQ Newbie
 
Registered: Apr 2002
Distribution: redhat7.2
Posts: 7

Rep: Reputation: 0
Is expect working from the command line?

If you make the current directory /usr/bin/expect (I'm assuming this is where you installed expect) and type in "./expect" at the prompt does the prompt change to "expect1.1>"?

Do you have TCL installed?
 
Old 05-07-2002, 02:22 PM   #4
vfs
Member
 
Registered: Apr 2002
Location: Brazil
Distribution: Slackware
Posts: 184

Rep: Reputation: 30
Try this:

which expect

This should find expect, if it's in you $PATH .

For the sake of portability, follow the man pages instructions:

Put this as the first lines of your script:

#!/bin/sh
# \
exec expect "$0" "$@"

Your script goes here.

# EOF

regards,

vfs.
 
  


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
Scripts & Environment Variables geeman2.0 Linux - General 12 07-05-2005 05:10 PM
bash & perl scripts scribbler001 Programming 1 04-26-2005 04:56 AM
apache & cgi scripts maze_fire Linux - Networking 1 08-12-2004 02:58 PM
daemons & hotplug scripts mikaelo Programming 9 05-25-2004 10:15 PM
WVdial gets "NO CARRIER" && network scripts maybe?? jfish Linux From Scratch 1 01-17-2004 03:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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