Linux - SoftwareThis 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
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.
Hi,
I am trying to write a bash login script for
Montavista Linux. I copied one from off the net:-
#!/bin/bash
read parameter1
spawn ssh pblades@smokey
# Look for password prompt
expect "*?assword:*"
# Send password aka $password
send -- "$parameter1\r"
# send blank line (\r) to make sure we get back to gui
send -- "\r
but the line,
spawn ssh pblades@smokey
and in fact any use of spawn is rejected as
an unknown command.
Does anyone know why this might be and if there
is an alternative?
Spawn isn't installed, or isn't in your path. As super-user, run this:
find / -name spawn
It'll chew for a while, then (if spawn is found), tell you where it is. You can either specify the entire path in the login script, or you can modify your PATH environment variable to put spawn in a place where it's found.
If it's not installed, you'll have to install it if you want to use it.
From this post it is not very clear what you are trying to do, however the script looks like an expect piece of code. Indeed, spawn is not a linux command by itself, but you have to install expect in order to run this kind of script.
The script is intended to carry out a login via
ssh pblades@smokey
and send a stored password back to complete the
login (it will then go onto set a clear case view and source my .bash_profile)
Hi,
I have changed the script so it does not do the ssh login line
in background (& removed) but it now simply prompts the
user for the password. Running the script in debug (bash -x <script>) the expect "....password:" line after the ssh is not
being carried out.
Hi,
the problem appears to be that there is no spawn program
on Montavista linux does anyone know where it can be downloaded
from and if its then safe to use?
Yeah... we already pointed it out. Spawn is a command coming from expect. See the link I have posted above. I have no knowledge about Montavista and what kind of software installer it uses, but for sure you can figure out how to accomplish this task. Last chance: install from source after downloading it from the expect site.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.