Operating System - HP-UX
1828919 Members
2646 Online
109986 Solutions
New Discussion

Re: Help with TERM command

 
SOLVED
Go to solution
Mark Lawley
Contributor

Help with TERM command

I am trying to decipher a script written by somebody else and am having problems with one particular line:

TERM="$TERM=$command" exec rlogin "$host" -l "$user"

This line works, for example I can perform top on server hostb with

TERM=wyse60=top exec rlogin hostb -l usera

My question is can anybody explain how/why this command works? I ha ve looked at the man page for TERM and this doesn't really help.
5 REPLIES 5
Ramkumar Devanathan
Honored Contributor

Re: Help with TERM command

Can't comment right now. require the full script :)

could you attach it if it is long or paste it if it is not?

- ramd.
HPE Software Rocks!
James R. Ferguson
Acclaimed Contributor
Solution

Re: Help with TERM command

Hi Mark:

The appropriate value for 'TERM' is usually derived during the login process. If you examine '/etc/profile' for instance, you will see that the value is selected based on a dialog with the terminal device with 'ttytype'.

The concept of the 'terminfo(4) database is to define sequences of characters necessary to elicit a particular behavior for a particular terminal type. For example, the sequence of characters necessary to enable text highlighting may differ for a 'vt100' terminal versus a 'wyse' one. In lieu of an application having to define every sequence of control to do simple text enhancements, for instance, the application can leverage 'tput' in order to present the appropriate controls to the particular device to affect the intended function.

Have a futher look at the man pages for 'terminfo(4), 'tput(1), and 'ttytype(1)'.

Regards!

...JRF...
Paula J Frazer-Campbell
Honored Contributor

Re: Help with TERM command

Hi

The commad is taking the TERM that you specified and using it on the server you are rlogin to.

It saves doing :-

rlogin hostb
TERM=wyse60
usera
top

The Line

TERM="$TERM=$command" exec rlogin "$host" -l "$user"

Is asking for the four variables and taking then into the command structure it is all encompassed in one.

Paula

If you can spell SysAdmin then you is one - anon
Ramkumar Devanathan
Honored Contributor

Re: Help with TERM command

Paula and JRF,

I don't really understand the TERM="$TERM=$command" part.

# TERM="wyse60=top" exec rlogin -l

when i try the above command with proper hostname and user, i get the following after i login -

Type wyse=top unknown.

I believe TERM="$TERM=$command" is a typo.

Mark that's why i thought it'd be useful if you'd paste out/attach the script.

- ramd.
HPE Software Rocks!
Paula J Frazer-Campbell
Honored Contributor

Re: Help with TERM command

Mark

Can you please post the full script.

Paula
If you can spell SysAdmin then you is one - anon