On Wed, 6 Nov 2002, Grigsby, Garl wrote:
>On a daily basis I work on a number of different Unix platforms including
>Linux, HP-UX, Solaris, AIX, and IRIX. Most of my work is done from either
>a HP-UX machine or a Linux machine. Most of these systems use a different
>character for "erase" (HP uses 'DEL', Sun uses '^h', Linux uses '^?'). I
>know that I can change the character by doing "stty erase ^?", but this
>gets a bit tiresome. Has anybody devised a way to determine what the
>setting should be for the type of terminal you are on and set it that
>way? If so, can you share, please.....
Here's an outline of something you can add to a .profile or .bash_profile,
after the part that sets $TERM:
case "X$TERM" in
Xsun) stty erase ^h # Sun uses ^h
;;
Xvt[123]*|Xlinux) stty erase ^? # VTx00 & Linux use ^?
;;
Xsomething-else) # add other cases here
;;
*) # handle none-of-the-above here
;;
esac
The syntax for csh & tcsh is different:
switch("X$TERM")
case Xsun:
stty erase ^h
breaksw
case Xvt[123]*:
case Xlinux:
stty erase ^?
breaksw
case Xsomething-else:
breaksw
default:
breaksw
endsw
That goes in your .login file, after the part that sets $TERM.
- Neil Parker, [EMAIL PROTECTED]
_______________________________________________
Eug-LUG mailing list
[EMAIL PROTECTED]
http://mailman.efn.org/cgi-bin/listinfo/eug-lug