sh: /usr/local/bin/stty: not found ??

Im trying to use the command expect (installed correctly) and im getting the next error, can anyone help please??
what should i do?

#!/usr/bin/expect -f
#!/bin/ksh

spawn ssh user@machine2 data/test.sh

expect "Password:"

send "pass001\r"
error turned:

Open in new window


sh: /usr/local/bin/stty: not found
LVL 1
celticianAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

woolmilkporcCommented:
For some reason your expect implementation "expects" stty to reside in /usr/local/bin.

Now the usual place is /usr/bin, so you could create a link (while logged in as root) and retry:

ln -s /usr/bin/stty /usr/local/bin/stty

If /usr/local/bin does not exist create it beforehand (again, as root)  with "mkdir /usr/local/bin"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
celticianAuthor Commented:
ok, then should i contact the system admin to do so?? (i'm not)

thanks!
0
woolmilkporcCommented:
Yes, you should. On standard systems /usr/local and /usr/local/bin (if present) are not writeable by regular users.

Perhaps this admin can also tell you why expect would search stty in /usr/local/bin! This should only happen when the expect binary has been compiled from source at your location.
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

MikeOM_DBACommented:
Also on other flavors it resides in /usr/bin/stty.
---- Ooops already posted :p
0
jmcgOwnerCommented:
I wonder about the file data/test.sh that your ssh command is requesting be run on the target machine. Is it possible that the error message you are seeing returned is coming from the remote session rather than a local message?
0
woolmilkporcCommented:
Good point!
0
celticianAuthor Commented:
Ok, it seems to be solved now, but just to clarify some things:

I didnt have expect installed and i asked my system admin to install expect for me, so he probably used my username or installed it just for me as these are very large machines (this is a very large company) with tens of thousands of users.
0
woolmilkporcCommented:
Wouldn't it have been better convincing your admin to set up passwordless (public-key) ssh acces for your userid on the source machine to "user" on "machine2"?
0
celticianAuthor Commented:
Yes, of course, but the permissions in that folder (777) don't allow ssh to be used...
0
celticianAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for celtician's comment #a40729820

for the following reason:

I gave that sentene to the system admin and now im not getting the error anymore.the script is not working yet though :)
0
woolmilkporcCommented:
Didn't any of our answers help you?
0
celticianAuthor Commented:
Ooops i clicked in my own answer by mistake, i have changed that, points should have been asigned now.
0
woolmilkporcCommented:
Thank you!

And if "the script is not working yet though" - we are always here to help. Please don't hesitate to ask for assistance!
0
celticianAuthor Commented:
ill post another question. thanks!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.