Link to home
Start Free TrialLog in
Avatar of celtician
celticianFlag for American Samoa

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of celtician

ASKER

ok, then should i contact the system admin to do so?? (i'm not)

thanks!
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.
Also on other flavors it resides in /usr/bin/stty.
---- Ooops already posted :p
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?
Good point!
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.
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"?
Yes, of course, but the permissions in that folder (777) don't allow ssh to be used...
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 :)
Didn't any of our answers help you?
Ooops i clicked in my own answer by mistake, i have changed that, points should have been asigned now.
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!
ill post another question. thanks!!