HP-UX Reference (11i v1 05/09) - 1 User Commands A-M (vol 1)

k
ksh(1) ksh(1)
These rules effectively give the writer of the
.profile le complete control over user actions, by per-
forming guaranteed set-up actions and leaving the user in an appropriate directory (probably not the login
directory).
The system administrator often sets up a directory of commands (usually
/usr/rbin) that can be safely
invoked by
rksh. HP-UX systems provide a restricted editor
red (see ed(1)), suitable for restricted
users.
COMMAND-LINE EDITING
In-line Editing Options
Normally, each command line typed at a terminal device is followed by a new-line (carriage-return or line-
feed). If either the
emacs, gmacs,or
vi option is set, the user can edit the command line. An editing
option is automatically selected each time the
VISUAL or EDITOR variable is assigned a value ending in
either of these option names.
The editing features require that the user’s terminal accept Return as carriage return without line feed and
that a space character must overwrite the current character on the screen. ADM terminal users should set
the ‘‘space/advance’’ switch to ‘space’’. Hewlett-Packard terminal users should set the straps to
‘‘bcGHxZ etX’’.
The editing modes enable the user to look through a window at the current line. The default window width
is 80, unless the value of
COLUMNS is defined. If the line is longer than the window width minus two, a
mark displayed at the end of the window notifies the user. The mark is a
>, <,or * if the line extends
respectively on the right, left, or both side(s) of the window. As the cursor moves and reaches the window
boundaries, the window is centered about the cursor.
The search commands in each edit mode provide access to the history file. Only strings are matched, not
patterns, although a leading
ˆ in the string restricts the match to begin at the first character in the line.
Emacs Editing Mode
This mode is invoked by either the emacs or gmacs option. Their sole difference is their handling of
ˆT.
To edit, the user moves the cursor to the point needing correction and inserts or deletes characters or
words. All editing commands are control characters or escape sequences. The notation for control charac-
ters is circumflex (ˆ) followed by the character. For example,
ˆF is the notation for Ctrl-F. This is entered
by pressing the
f key while holding down the Ctrl (control) key. The Shift key is not pressed. (The nota-
tion
ˆ? indicates the DEL (delete) key.)
The notation for escape sequences is M- followed by a character. For example, M-f
(pronounced Meta f) is
entered by depressing ESC (ASCII 033 ) followed by
f. M-F would be the notation for ESC followed by
Shift (capital) F.
All edit commands operate from any place on the line (not only at the beginning). Neither the Return nor
the Line Feed key is entered after edit commands, except when noted.
ˆF Move cursor forward (right) one character.
M-f Move cursor forward one word. (The editor’s idea of a word is a string of characters consist-
ing of only letters, digits and underscores.)
ˆB Move cursor backward (left) one character.
M-b Move cursor backward one word.
ˆA Move cursor to start of line.
ˆE Move cursor to end of line.
ˆ]char Move cursor forward to character char on current line.
M-ˆ]char Move cursor backward to character char on current line.
ˆXˆX Interchange the cursor and mark.
erase (User defined erase character as defined by the stty(1) command, usually ˆH or #.) Delete
previous character.
ˆD Delete current character.
eof End-of-file character, normally ˆD, terminates the shell if the current line is null.
M-d Delete current word.
M-ˆH (Meta-backspace) Delete previous word.
M-h Delete previous word.
M-ˆ? (Meta-DEL) Delete previous word (if interrupt character is ˆ? (DEL, the default) this com-
mand does not work).
ˆT Transpose current character with next character in emacs mode. Transpose two previous
characters in gmacs mode.
HP-UX 11i Version 1: September 2005 18 Hewlett-Packard Company Section 1427