Operating System - HP-UX
1832757 Members
3197 Online
110045 Solutions
New Discussion

problem with stty and remsh

 
SOLVED
Go to solution
eran maor
Honored Contributor

problem with stty and remsh

Hi

i m trying to run a short script that i worte

echo " please give you name "
stty -echo
read name
stty echo
clear
echo " your name is $name "

when i m running it on local server - o. k

but when i try to run it with remsh getting

stty: : Operation not supported

didnt found any reference about this error with stty or remsh .

can anybody also give me another solution ?
love computers
2 REPLIES 2
Victor BERRIDGE
Honored Contributor
Solution

Re: problem with stty and remsh

Hi Eran,
Im very busy at the moment Im sorry, there is a difference between executing from local: you have TERM set. when you execute remsh, i think it doesnt read users .profile and so no tty...

I would investigate this point if I were you:
/home/vbe> remsh octant "env"
_=/usr/bin/env
PATH=/usr/bin:/usr/ccs/bin:/usr/bin/X11:/usr/contrib/bin:/usr/local/bin:
LOGNAME=vbe
SHELL=/usr/bin/ksh
HOME=/home/berridge
PWD=/home/berridge
TZ=MET-1METDST
caph:/home/vbe>
octant:/home/berridge $ env
_=/usr/bin/env
MANPATH=/usr/share/man/%L:/usr/share/man:/usr/contrib/man/%L:/usr/contrib/man:/usr/local/man/%
L:/usr/local/man:/opt/upgrade/share/man/%L:/opt/upgrade/share/man:/usr/dt/share/man:/opt/pd/sh
are/man/%L:/opt/pd/share/man:/opt/ignite/share/man/%L:/opt/ignite/share/man:/opt/pred/share/ma
n/%L:/opt/pred/share/man:/opt/audio/share/man:/opt/blinklink/share/man:/opt/ansic/share/man/%L
:/opt/ansic/share/man:/opt/langtools/share/man/%L:/opt/langtools/share/man:/opt/imake/man:/opt
/hparray/share/man/%L:/opt/hparray/share/man:/opt/hpnp//man:/opt/samba/man/%L:/opt/samba/man:/
opt/resmon/share/man
PATH=.:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/op
t/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/pred/bin:/opt/l
angtools/bin:/opt/imake/bin:/opt/hparray/bin:/opt/sas:/var/opt/sas/ocstat/bin:/opt/prod/menu:/
opt/prod/utl:/opt/hpnp//bin:/opt/samba/bin:/opt/ignite/bin:/opt/resmon/bin
COLUMNS=94
EDITOR=vi
HISTFILE=/home/berridge/.sh_history
LOGNAME=vbe
ERASE=^H
PS1=octant:$PWD \$
SHELL=/usr/bin/ksh
HISTORY=2048
HISTSIZE=4098
TMOUT=7200
HOME=/home/berridge
FCEDIT=/usr/bin/vi
TERM=hpterm
PWD=/home/berridge
TZ=MET-1METDST
ENV=/home/berridge/.kshrc
LINES=46
A__z=-5TMOUT

I named your script stty_test01 on octant.
This is my output:
caph:/home/vbe> remsh octant "./stty_test01"
stty: : Unknown error
please give you name
victor
stty: : Unknown error
your name is victor
caph:/home/vbe>

If I find some time this evening I will give a look at your problem if you havent found a solution...

Best regards
Victor
Wieslaw Krajewski
Honored Contributor

Re: problem with stty and remsh

Hi,

stty command is to disaplay or set options for the device that is your current standard input. When you run your script remotely, via remsh, your standard input is on the local machine where you are working, whereas stty is run on the remote machine. This explains the error you observe.
I think, a simple way is to ask for the user name locally and then to pass this name to the remote machine to check if an user can run what you would like to be run or not. Exactly as the standard services like telnet , ft and so on do.

Hope this helps.

Rgds.
Permanent training makes master