ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
A brief examination of the code tells me that you haven't got `expect` installed. Please verify that you do have `expect` on the machine, and if necessary, use the full path to `expect` if it is not in your $PATH.
I'm not sure why the error indicates the error is on line 15, but then, there are many cases I've seen where shell gives error line# that is not actually where the error is - but verify that you have `expect` first. If not, install it and try your script again.
NOTE: It may help us if you tell us what Linux OS you are using (since you posted from Windows, we cannot even guess) but I believe `expect` is normally installed on Linux in general.
(1) expect is the name of a package that has to be installed before testing the syntax of your script.
(2) If you tell which distro (distribution) you are using, we may be able to tell you how to check if expect is installed or not and if not installed, how to download and install under linux.
how to check it is install or not if it is not from where i will get
Download for my Centos 5.2 ( Final).
Regards
Dhiren sha
Quote:
Originally Posted by AnanthaP
Arre dhiren,
(1) expect is the name of a package that has to be installed before testing the syntax of your script.
(2) If you tell which distro (distribution) you are using, we may be able to tell you how to check if expect is installed or not and if not installed, how to download and install under linux.
You could see if it were installed just by running the `expect` command from your shell, or running `which expect`, or by asking your package installer, which I believe is called "yum". Since I don't use or know about "yum", and I don't use CentOS, you will have to await help on that from a yum/CentOS user; but the yum manpage should have a good explanation of possible commands. To read the man page:
Code:
shell$ man yum
Here's what I'd do meanwhile, to see if `expect` is installed:
Code:
# let's ask where expect is located:
shell$ which expect
/usr/bin/expect << tells me that `expect` is in /usr/bin/
# Let's try starting expect command-line:
root@reactor: expect
expect1.1> << Look~ the expect1.1 command interpreter has started, so I have `expect`. (Type "exit" to quit)
Here's a yum command to install `expect` - but as I said, I haven't a clue if this is the right command, so either read the instructions, or await further help, or try this at your own risk:
Code:
# For RHEL/OEL/Centos version 5:
shell$ sudo yum install expect expectk
Finally, here's a page from the CentOS wiki/main site, which you can go to and select an information topic about CentOS. The first subject on the list is dealing with CentOS repositories - repositories are where you get your software packages from: http://wiki.centos.org/AdditionalResources
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.