lipton@halleys.UUCP (04/06/87)
Thanks for the responses to my question about defining VT240 function
keys under ULTRIX. The most useful suggestion was from Bruce Wisentaner,
who suggested that I "alias" the character sequences produced by the
function keys. I have taken that idea and expanded it a bit. I have
created a file called "defkey", below:
#
echo -n alias $argv[1] \'echo >> ~/.defkeys
echo ' "^[[1A$prompt' $argv[2] '"' \;$argv[2]\' >> ~/.defkeys
To use it, I type "defkey", the press the key I want to define, and
then type the definition, in double quotes if it is more than one word.
For example, to define the FIND key to do "ls -lt" I type
defkey ^[[1~ "ls -lt"
This will append an entry to a file called .defkeys in my home directory.
Then I need the statement "source .defkeys" in my .login file to activate
the definitions. Then, whenever I type FIND and carriage return, first I
will see the escape sequence [1~, then "ls -lt" will be written over
that, and then "ls -lt" will be executed.
It's not as nice as VMS, but it's better than nothing.
--
Gary Lipton - Massachusetts Microelectronics Center ## ## 2 #####
lipton@m2c.org (CSNET and Internet with MX support) ### ### ##
lipton%m2c.org@relay.cs.net (Internet) ## # ## ##
{harvard,bu-cs,frog,ulowell}!halleys!lipton (UUCP) ## ## #####