Previous Table of Contents Next


Emacs/Gmacs In-Line Editor Commands

Ctl-b move left one character
Ctl-f move right one character
Esc-b move left one word
Esc-f move right one word
Ctl-a move to beginning of line
Ctl-e move to end of line
Ctl-h delete preceding character
Ctl-x delete the entire line
Ctl-k delete from cursor to end of line
Ctl-d delete current character
Esc-d delete current word
Ctl-w delete from cursor to mark
Ctl-y undo last delete (w/Esc-p)
Ctl-p get previous command from history file
Ctl-n get next command from history file
Ctl-o execute current command line and get the next command line
Ctl-rstring search backward in history file for command that contains string
Ctl-c change current character to upper case
Esc-c change current word to upper case
Esc-l change current character to lower case
Esc-p save to buffer from cursor to mark
Esc-<SPACE>, Ctl-@ mark current location
Ctl-l redisplay current line
Ctl-]c move cursor forward to character c
Ctl-xCtl-x interchange the cursor and mark
erase delete previous character
Esc-Ctl-h delete previous word
Esc-h delete previous word
Ctl-t transpose current and next character (emacs)
Ctl-t transpose two previous characters (gmacs)
Ctl-j execute the current line
Ctl-m execute the current line
Esc-< get the oldest command line
Esc-> get the previous command line
Esc-n define numeric parameter n for the next command (command can be Ctl-c, Ctl-d, Ctl-k, Ctl-n, Ctl-p, Ctl-r, Esc-., Ctl-]c, Esc-_, Esc-b, Esc-c, Esc-d, Esc-f, Esc-h, Esc-l, Esc-Ctl-h)
Esc-c insert value of alias _c (c cannot be b, c, d, f, h, l, or p)
Esc-., Esc-_ insert last word of previous command
Esc-Esc replace the current word with the filename that matches word*. For unique matches, append a / to directories and " " (space) for files
Esc-= list the files that match the current word*list the files that match the current word*
Ctl-u multiply parameter of next command by 4
\ escape the next character
Ctl-v display the version of the shell
Esc-# insert a # (comment) at beginning of the current line

JOB CONTROL

Job control is a process manipulation feature found in the Korn shell. It allows programs to be stopped and restarted, moved between the foreground and background, their processing status to be displayed, and more. To enable job control, the monitor option must be enabled. By default, this is enabled on systems that support the job control feature. When a program is run in the background, a job number and process id are returned.

Job Control Commands

bg put the current stopped job in the background
bg %n put the stopped job n in the background
fg move the current background job into the foreground
fg %n move background job n into the foreground
jobs display the status of all jobs
jobs –l display status of all jobs along with their process ids
jobs –p display the process ids of all jobs
kill –l list all valid signal names
kill [signal] %n send the specified signal to job n (default 9)
set –m, set –o monitor enable job control
stty [–]tostop allow/prevent background jobs from generating output
wait wait for all background jobs to complete
wait %n wait for background job n to complete
Ctl-z stop the current job

Job Name Format

%n job n
%+, %% current job
%– previous job
%string job whose name begins with string
%?string job that matches part or all of string

ARITHMETIC

Integer arithmetic is performed with the let and ((...)) commands. All of the operators from the C programming language (except ++, ––, and ?:) are supported by the Korn shell. The format for arithmetic constants is:

           number   or   base#number

where base is a decimal number between 2 and 36 that specifies the arithmetic base. If not specified, the default is base 10. The arithmetic base can also be set with the typeset –i command.

Arithmetic Commands

let "arithmetic-expression"
((arithmetic-expression)) evaluate arithmetic expression
integer variable declare an integer variable
integer variable=integer-value declare an integer variable and set it to a value
integer variable="arithmetic-assignment-expression" declare an integer variable and assign it the value of the arithmetic-assignment-expression
typeset –in variable[=value] declare a base n integer variable, and optionally assign it a value


Previous Table of Contents Next
1