Solved

answerback in unix login, to pass terminal type through telnet

Posted on 2000-05-10
8
690 Views
Last Modified: 2013-12-26
How do I query what the answerback setting is so I can set the TERM environmental variable through a telnet?  UNIX.

Thanks.
0
Comment
Question by:doar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2798767
How to query the "answerback" and what the reponse is elicited is highly dependant on what the terminal is. When dumb terminals were more popular, I remember a number of programs being posted to various Usenet groups that intelligently interrogated a terminal to determine what it was. They are probably still around somewhere on ftp.uu.net, but I can't remember any of the names.
0
 

Author Comment

by:doar
ID: 2798959
To be specific, I have a remote terminal, running a version of MS DOS, and using a tcp/ip program to connect.  And I want to be able to distinguish between this terminal and normal terminals (due to its small screen).  The tcp/ip software has a place to set the "answerback" and I was told that could be used to give a terminal type of something like: wy60small or whatever I choose...I'll check that site to see if it has my answer...anyone else know the answer would be helpfull...
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2800003
If you only have this one terminal to deal with and it has a fixed IP, you could key off of where the remote session originates from. That wouldn't even require answerback. Something along the lines of:

`who | grep special-host >/dev/null`
if [ $? = 0 ]; then
  TERM=wy60small
  export TERM
fi

in your shell init script should do it.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:kiffney
ID: 2800597
Another way to do this, if the dos terminal does support answerback, is just send the ENQ character '\005' to the terminal on login and capture what the terminal says back.  
0
 

Author Comment

by:doar
ID: 2801150
Jlevies comment is a good idea, however since I will be having  a bunch of these (all with fixed ip's), I would have to manage a list of IP's.

Kiffney, your soln seems to be what I am looking for, however I do not know how to send an ENQ to the dos terminal, could you enclose a code snippet, and ill put it in the .profile of the unix box login to try it.
0
 

Author Comment

by:doar
ID: 2801232
Jlevies comment is a good idea, however since I will be having  a bunch of these (all with fixed ip's), I would have to manage a list of IP's.

Kiffney, your soln seems to be what I am looking for, however I do not know how to send an ENQ to the dos terminal, could you enclose a code snippet, and ill put it in the .profile of the unix box login to try it.
0
 
LVL 4

Accepted Solution

by:
kiffney earned 25 total points
ID: 2801474
Something like

echo -ne "\005" && read && TERM=$REPLY

should work. Actually when I try it it works, but I still get the answerback reply stuffed into the keyboard buffer too.  Maybe some bash wizard can step in here and fix that.  
0
 

Author Comment

by:doar
ID: 2806393
Thanks guys for the help, I "avoided" the keyboard input buffer thingy by a
kind of work around:

awk 'BEGIN {

        eh = sprintf("echo -n \"\005\" ")
        system("stty -icanon min 0 time 1")
        system(eh)
        getline bah
        printf("%s\n",bah)
        system("stty icanon")

}'

It may not be the best solution but it does what I want, so basically I am
able to read the answerback with this, and hand it to the TERM environmental
variable.  The only problem with this is that it echo's the 005 as a command
to the shell if there is no answerback, and gets some command not found or
something harmless.  (btw there isn't a -e for the echo in my unix
environment Unixware).  Ok, thanks again guys!
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 146
method notes when mouse over in eclipse 5 95
lucky13 challenge 11 167
x-bar in Google Sheets 2 129
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question