Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script Question

Status
Not open for further replies.

Pilot1

IS-IT--Management
Feb 22, 2001
118
US
I'm quite green with this art as of yet. I was writing a simple script to collect the names of who is logged on and echo this to the screen and then repeat this every 10 seconds (useful when trying to get everyone in 5 remote locations to log off!) and then exit with a delete key (via a remote ttyp terminal). On the console delete works great, but at a remote log in the delete key won't work. Obviously the emulator (Anita running on a Windows box) is not sending the correct string or what??? Is there a way to trap this key with a line in the script? Here is script.

while true
do
echo&quot;Press <Del> Key to terminate. You will then be dropped from shell.&quot;
echo&quot;If using Facetterm hit CTRL-W-A to re-activate window&quot;
who | grep -v getty | sort
Sleep 10
done
exit

Thanks in advance! Pilot1
 
If you are logging in as the same user, the problem is that the emulator isn't sending the delete key sequence.

If you can't easily fix that, change intr to CTRL-C- at the top of your script put

stty intr ctrl-c

(press ctrl-v and then ctr-c in vi to enter the ctrl-c)

Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
This may sound like a stupid question, but what string is echoed by the delete key? We are using VT-220 emulation with this software. If I use good old SCO ANSI most of the keyboard mapping nightmares go away. Also, I think Facetterm may aggravate some problems. We have to map all F-keys from F5 on up. We use ^[5 for F5 and just F6 for F6 key, F7 for F7 key up to F12. So back to the original question, the delete key. Have any suggestions at to what string to use?

Thanks in advance
Pilot1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top