- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Function Keys in script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2001 09:11 AM
09-04-2001 09:11 AM
I am using HummingBird Exceed xterm. I am using Korn shell, how can I assign Function keys in order to run my assign scripts(Eg. F5 will run abcd.ksh). I don't want to go for emacs. I know I have to add into .profile but how and what value for these function keys. Help or hint will be appreciated.
Thanks
Zafar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2001 01:18 PM
09-04-2001 01:18 PM
Re: Function Keys in script
Thanks,
Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2001 03:58 PM
09-04-2001 03:58 PM
Re: Function Keys in script
man terminfo
or use this quick reference guide:
DISCLAIMER: function keys are terminal (or emulator) dependent! That means that if your terminal does not support function keys (aka, programmable keys) then these commands produce a NOP (ie, nothing). To determine if your terminal (based on $TERM) supports these features, use the command:
untic $TERM | grep rmln
as an example to see if rmln works on this terminal (based on the terminfo database stored as binary files in the directory /usr/lib/terminfo/*). For those of you with a true HP smart terminal (262x, 239x, 700/9x) or HP terminal emulator such as hpterm or WRQ's Reflection/1 or Reflection for HP (not to be confused with Reflection/x), QCterm, Minisoft's HP emulator, Attachmate's KEA!, and a few others, these commands will work just fine.
Onward ...
tput smln (turns on the softkey labels)
tput rmln (turns off the softkey labels)
If the above two commands, pop up the softkey labels, proceed...if not, get a smart HP terminal emulator. Here is a link for HP terminal emulators: http://directory.google.com/Top/Computers/Systems/HP_3000/Terminal_Emulators/
They say HP 3000 but they are fine for the HP 9000 and make working with character mode SAM and swinstall MUCH easier.
To load the keys, use the commands in this order:
tput rmln
tput pln 1 "cd /tmp"
tput pfx 1 "cd /tmp"
tput pln 2 "BDF hfs"
tput pfx 2 "/usr/bin/bdf -t hfs"
tput pln 3 "LongList"
tput pfx 3 "/usr/bin/ls -alF"
tput smln
So, to explain the manspeak (language used in man pages), rmln is the code for "Turn off soft labels" and smln is the code to turn on the softkey labels. pln is the command to store text into the softkey label and requires 2 parameters: softkey# "text" (use quotes in case there are imbedded spaces), and pfx programs the softkey# to transmit the string as in:
tput pln 8 "bye bye"
tput pfx 8 "clear;exit"
which programs softkey 8 (usually shows f8 as the label) to display "bye bye", then loads key f8 to transmit clear and exit.
NOTE: Some emulators may not display the new labels unless the display is turned off, so turn off the labels, load the keys and labels, then turn them on as in the example for f1 f2 f3 above.
tput is the most powerful tool there is for handling every terminal WITHOUT using a hardcoded escape sequence. It is impossible to predict what terminal someone is using so by using a terminal ID program (ttytype -s or tset) to set $TERM, then a list of all the supported sequences is immediately available to tput. Standard /etc/profile and .profile will have an automatic terminal ID but is successful only when the terminal or emulator is a Wyse, VT100 or HP style...your mileage may vary.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 03:57 AM
09-05-2001 03:57 AM
SolutionHow to change a function key (or any key code for that matter):
(01) Start exceed
(02) Right click on the exceed "server" and choose tools->configuration (or xconfig)
(03) From the ?Xconfig? screen, double click on "keyboard input"
(04) From the ?Keyboard Input? screen, in the ?Keyboard Mapping" area, select "edit"
(05) A map of your keyboard will pop up (the XKEYS screen), immediately select file->save as,. and choose an new file name (this prevents you from destroying your keyboard), I added the string "new_" in front of "us.kbf" as in new_us.kbf
(06) From the ?XKEYS? screen Select edit->macros
(07) On the new popup, the ?Macros? screen, select "add"
(08) On the new popup, the "Macro binding" screen, select browse.
(09) On the new popup, the ?Macro Selector? screen, verify that the "macro file" is the new name of your keyboard file (new_us.kbf)
(10) From the ?Macro Selector? screen, select the ?add? key
(11) From the new popup, the ?New Macro Properties? screen, give it a name and a description
(12) Select the ?Start Record? button
(13) Then type in your ?string?, as in /usr/bin/myscript.sh
(14) Select the ?Stop Record? when you are done
(15) Select the ?OK? button
(16) When you are done adding your macro, select the ?OK? button (on the Macro Selector screen)
(17) Now you must ?bind? a function key to your macro, (your macro name should appear in ?grayed out? in the ?selected macro? area) in the bind key area select a function key, like f12 for example
(18) Then change the ?Modifier? from ?none? to ?Control?, this will allow you to use the normal function key, if you don?t change the modifier, then some apps that use this function key will not work any more and will produce undesired results.
(19) From the ?Macro Binding? screen select ?OK?
(20) From the ?Macros? screen, select ?Close?
(21) From the Keyboard map, select file->exit
(22) Save the changes, and make sure they are being saved into your new keyboard mapping file (new_us.kbf)
(23) Close all of your exceed sessions, and exceed itself, or perform a ?exceed server reset? (this will close any open Xsessions).
(24) Give it a try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 05:43 AM
09-05-2001 05:43 AM
Re: Function Keys in script
Thanks to Harry & Bill. Bill I am working on your suggestion also; but the major part is completed thru Harry.
Zafar