[SunHELP] stty erase

Brian Hechinger sunhelp at sunhelp.org
Wed Mar 28 17:17:01 CST 2001


----- Forwarded message from Mail Delivery System -----

got caught up here, sent this out this morning and left the house, never
expected it to not go through. :)

-- Start of included mail From:  Brian Hechinger <wonko at entropy.tmok.com>

> Ah, I misread his question. I thought he asked "how can I tell which
> machine I'm on, and set erase accordingly"

not a problem, happens to all of us, and you are one of the most useful people
on this list so we won't hold it against you. :)

> well, there's no apparent way to guess which OS you're coming from, from
> the remote shell's perspective.

this is one of those things that annoys me, but i'll live with it.

> unless you want to keep a list of remote IPs and their OS types in your
> .profile and match the REMOTEHOST variable to them and set
> accordingly. But REMOTEHOST isnt always set... depends on shell and
> service type (telnet, ssh)...

i don't trust REMOTEHOST since it isn't always set, but here is something
quick off the top of my head that may work.

TTY=`tty | cut -c 6-`
who | grep $TTY | awk 'BEGIN { FS="(" } {print $2}' | cut -d . -f 1

and then just compare the output of the second line with a list of hosts and
set the erase correctly using case or ifs or whatever you want, the rest is an
excercise left to the reader.  this works for both telnet and ssh.

if someone can clean this up, i'm new to awk, so this is my best shot real
quick.

cheers,

-brian



More information about the SunHELP mailing list