 |
» |
|
|
 |
You can configure Key Shell's appearance and behavior through
several options. These options are accessed with the Keysh config
softkey or the special kc
command. You can make the following changes to keysh: Adding, moving, and deleting softkeys. Changing the status line. Saving configuration changes. Undoing any configuration changes.
The following sections describe how to do each of the above. Adding, Moving, and Deleting Softkeys |  |
This section explains how to add visible and invisible softkeys,
move softkeys, and delete softkeys. If you encounter errors while adding softkeys, refer to the
online help topic Errors. All softkeys have names, which are the HP-UX commands they
correspond to. Visible softkeys (the softkeys that appear on the
top-level softkey menu) also have labels, which are the words that
appear on the softkey itself. Labels allow you to give a less cryptic
name to a command. For example, Search lines
is the less cryptic label given to the grep
command. A label can have a maximum of 16 characters. Many of the following sections ask you to type a softkey's
name or label. If you refer to a softkey by its label, you must
replace any blank space in the label with an underscore "_".
For example, type Edit_file
or Create_dir. The preconfigured visible softkeys are listed in Table 26-3 “Visible Softkey Commands”. These softkeys appear
in the top-level softkey menu. You can also create your own visible
softkeys or add any of the invisible softkeys listed in Table 26-4 “Invisible Softkey Commands” and make them visible.
Creating your own softkeys is described in Chapter 27 “Customizing the Key Shell”. To add a visible softkey, follow these steps: Select Keysh config softkey
add. Type the name of an invisible softkey as listed
in Table 26-4 “Invisible Softkey Commands”, or the name
of a softkey you have created. By default, the softkey label that will appear on
the menu is the same as the softkey's name. To specify a label that is easier for you to remember, select
with label, then type the label. By default, the softkey is added from /usr/keysh/C/softkeys.
If you want to add softkeys from another file, do either of the
following: Select from file,
then type the name of the file containing the softkey you want to
add. Select from user,
then type the name of the user whose $HOME/.softkeys
file contains the softkey.
Note that when you add a softkey, the remaining softkeys from
that file are automatically loaded for use as invisible softkey
commands. To place the softkey in the default position (after
all the other softkeys), press Return. Otherwise, select and place,
select where the softkey should be placed in the menu, and press
Return. If you select and place
before softkey, you will be prompted
to type the name or label of the existing softkey before which you
want the new softkey to be placed.
Following are some examples that illustrate adding visible
softkeys: To add the od
softkey to the end of the top-level softkey menu and label it Octal dump,
use this command: Keysh config softkey add od with label Octal_dumpReturn To add the paste
softkey to the beginning of the top-level softkey menu, use this
command. The softkey will be labeled Paste
by default. Keysh config softkey add paste and place as first softkeyReturn To add the custom emacs
softkey from the file /users/rpt/.softkeys
to the top-level softkey menu immediately before the ls
softkey, use this command: Keysh config softkey add emacs from user rpt and place before softkey lsReturn To change the definition of the Mail
softkey so that it calls the elm
mailer instead of the mailx
mailer, use the following command. Keysh config softkey add elm with label Mail and place as first softkeyReturn
Table 26-3 “Visible Softkey Commands” shows the
visible softkey commands that are configured in keysh: Table 26-3 Visible Softkey Commands Softkey | HP-UX Equivalent | Function |
|---|
Mail | mailx | Processes electronic mail interactively. | Change dir | cd | Changes the current directory. | Listfiles | ls | Lists the contents of a directory. | Edit file | vi | Edits files on a screen-oriented display. | Display files | more | Displays the contents of a file one screen
at a time. | Print files | pr | lp | Formats a file and sends it to the line
printer. | Search lines | grep | Searches for lines matching a pattern. | Sort lines | sort | Sorts the lines of a file. | Find files | find | Locates files within a directory. | Copy files | cp | Copies file to another location. | Move files | mv | Moves or renames a file. | Set file attribs | | Changes permissions, owner, or group
of a file. | Remove files | rm | Deletes a file. | Remove dirs | rmdir | Deletes a directory. | Create dirs | mkdir | Creates a new directory. | Shell archive | shar | Bundles one or more files into a shell
archive package for mailing or moving. | Print status | lpstat | Shows current status of all printers. | Cancel print | cancel | Cancels a print request. | Process info | ps | Shows status of active processes. | Kill process | kill | Terminates a process. | Manual page | man | Accesses the online manual pages. | Keysh config | kc | Configures the appearance and behavior
of keysh. |
Adding Invisible SoftkeysThe preconfigured invisible softkeys are listed in Table 26-4 “Invisible Softkey Commands”. These commands do
not show up on the softkey menu, but if you type one of them, keysh
will recognize it and display the appropriate softkey options. You can also create your own invisible softkeys, as described
in Chapter 27 “Customizing the Key Shell”. To add additional invisible softkeys, follow these steps: Select Keysh config softkey
add invisibles. By default, invisible softkeys are added from /usr/keysh/C/softkeys.
If you want to add invisible softkeys from another file, do either
of the following: Select from file,
then type the name of the file containing the softkeys you want
to add. Then press Return. Select from user,
then type the name of the user whose $HOME/.softkeys
file contains the softkeys. Then press Return.
For example, to add all invisible softkeys from user rpt,
use this command: Keysh config softkey add invisibles from user rptReturn Table 26-4 Invisible Softkey Commands Softkey | Function |
|---|
adjust | Performs simple text formatting. | ar | Creates and maintains library archives. | bdf | Displays free disk space. | cal | Displays a calendar. | cancel | Cancels a print request. | cat | Concatenates and displays files. | cd | Changes the current directory. | cdb | C programming language symbolic debugger. | chatr | Changes a program's internal attributes. | chgrp | Changes the group of a file. | chmod | Changes the permissions of a file. | chown | Changes the owner of a file. | cmp | Compares two files and notifies you of
any differences. | col | Used with nroff(1)
to filter reverse linefeeds and backspaces. | comm | Prints all the lines common to two sorted
files. | cpio | Copies file archives. | cut | Cuts selected fields or columns from
a file. | dd | Copies a tape or file. | df | Displays the number of free 512-byte
blocks and free inodes on a file system. | diff | Compares two files and notifies you of
any differences. | dircmp | Compares two directories and notifies
you of any differences. | disable | Disables lp
printers. | du | Displays disk usage for files or directories. | elm | Processes electronic mail interactively. | enable | Enables lp
printers. | exit | Terminates the shell. | find | Locates files within a directory. | fold | Wraps text lines that exceed maximum
width. | grep | Searches for lines matching a pattern. | head | Displays the first ten lines of a file. | jobs | Displays all active jobs. | kill | Terminates a process. | lp | Sends files to an lp
printer or plotter. | lpstat | Shows current status of all lp
printers. | ls | Lists the contents of a directory. | mailx | Processes electronic mail interactively. | make | Maintains, updates, and regenerates groups
of programs. | man | Accesses the online manual pages. | mkdir | Creates a new directory. | more | Displays the contents of a file one screen
at a time. | nroff | Formats text for printing. | od | Creates an octal dump of a file. | paste | Merges the same line in several files
or subsequent lines of one file. | pg | Displays the contents of a file one screen
at a time. | pr | Formats text for printing. | ps | Shows the status of active processes. | remsh | Executes a command on a remote host. | rlogin | Connects your terminal to a remote host. | rm | Deletes files or directories. | rmdir | Deletes directories. | sdiff | Compares two files and displays a side-by-side
listing of any differences. | set | Sets shell options. | shar | Bundles one or more files into a shell
archive package. | sort | Sorts the lines of a file. | tail | Displays the last ten lines of a file. | tar | Creates, maintains, and accesses a file
archive on tape. | tcio | Improves data transfer rate to cartridge
tape. Commonly used with cpio(1). | tee | In a command pipeline, copies data passing
between commands to a file. | touch | Updates the access, modification, and
change times of a file. | tr | Translates characters. | umask | Sets file-creation mode mask. | uname | Displays the name of the current HP-UX
version. | vi | Edits files on a screen-oriented display. | wc | Counts lines, words, and characters in
a file. | who | Lists who is logged on to the system. | write | Interactively writes to another user. | xd | Creates a hexadecimal dump of a file. | xdb | C, FORTRAN, and Pascal symbolic debugger. |
To change the placement of a visible softkey, follow these
steps: Select Keysh config softkey
move. Type the name or label of the softkey you want to
move. Select where you want the softkey to be moved, then
press Return. If you select before softkey,
you will need to type the name or label of the existing softkey
before which you want the other softkey to be moved.
For example, to move the Mail softkey
to immediately before the Keysh config
softkey, use this command: Keysh config softkey
move Mail before softkey Keysh_configReturn To delete a visible softkey, follow these steps: Select Keysh config softkey
delete. Type the name or label of the softkey you want to
delete. Press Return.
For example, to delete the Edit file
softkey from the top-level softkey menu, use this command: Keysh config softkey
delete Edit_fileReturn Note that after deleting a softkey from the softkey menu,
you can still access the softkey invisibly. Changing Global Options |  |
This section explains the global configuration options found
under the Keysh config options
softkey menu. Global options allow you to control such things as
which type of softkeys are available for use, whether HP-UX translations
are displayed, and whether prompts are given. In the Keysh config options
menu, an asterisk next to an option name means that the option is
on. Global configuration options can be turned on and off with the
following commands: For example, to turn off the prompts, use this command: Keysh config options prompts off Return |
Table 26-5 “Global Options” describes the
global options: Table 26-5 Global Options Option | Default | Description |
|---|
help | Enabled. | If you set help
to off, the --Help-- softkey disappears,
but online help is generally still available by using the Tab
key. | invisibles | Enabled. | If you set invisibles
to off, keysh
will not recognize invisible softkey commands. | prompts | Enabled. | If you set prompts
to off, keysh
will not display prompt messages describing actions that are required
to complete the current softkey command. | selectors | Disabled. | If you set selectors
to on, an uppercase selector character appears in each softkey label.
Typing this character (unquoted) selects the softkey. keysh
automatically sets selectors
to on if you are using a terminal that does not support a sufficient
number of softkeys. | translations | Enabled. | If you set translations
to off, keysh
will not display the HP-UX translations of softkey commands before
executing them. | visibles | Enabled. | If you set visibles
to off, keysh
will not display softkey commands on the top-level softkey menu. If you are familiar with HP-UX commands (but not necessarily
with the options), you may wish to set visibles
to off. You can then decrease keysh
start-up time by editing .keyshrc
and removing the lines that add visible softkeys. |
Changing the Status Line |  |
In the Keysh config status line
menu, an asterisk next to a status line indicator means that the
indicator is on. You can turn the various status line indicators
on and off with the following commands: Keysh config status line indicator_softkey on Keysh config status line indicator_softkey off For example, to add your user name to the status line, use
this command: Keysh config status line user name onReturn |
Table 26-6 “Status Line Indicators” describes status
line indicators: Table 26-6 Status Line Indicators Indicator | Default | Description |
|---|
user name | Disabled. | Your user name. | host name | Enabled. | Your host name. | current_dir | Enabled. | The current directory. | mail_status | Enabled. | The mail status ("You have mail",
"No mail", or "You have new mail"). | date | Disabled. | The date. | time | Enabled. | The time of day. |
In addition, you can use the KEYSH
shell variable to add any arbitrary text to the status line. This
text is always displayed first. You can include the same type of
information in KEYSH
that you normally would in the PS1
variable. For more information, refer to “Setting Shell Variables”." Saving Configuration Changes |  |
If you want to manually write the configuration changes you
have made to your .keyshrc
file, select Keysh config write.
Note that keysh
automatically writes configuration changes as you make them. For example, if you have configured keysh
differently in two windows and you do not want to keep one of the
configurations, go to the window with the configuration you want
and select Keysh config write
to write that configuration to .keyshrc.
Then go to the other window and restart keysh. Restarting Key Shell |  |
After changing keysh's
configuration in one window, you can update the configuration of
any other windows by selecting Keysh config
restart in those windows. If you want keysh
to restart from the original default configuration, select Keysh config
restart default.
Any changes you have made to .keyshrc
will be lost. Undoing Configuration Changes |  |
If you want to undo the configuration changes you made, select
Keysh config undo.
This command undoes all configuration changes made since keysh
was last invoked or since the last Keysh config
undo command. It then rewrites your .keyshrc
file to reflect the undone changes. Selecting Keysh config undo
a second time will restore your configuration changes.
|