Category : OS/2 Files
Archive   : KSH48.ZIP
Filename : KSH.1

 
Output of file : KSH.1 contained in archive : KSH48.ZIP
.\" $Id: ksh.1,v 1.3 1992/12/05 13:14:37 sjg Exp $
.nr OJ 1 \" Job Control
.nr OE 1 \" Command Editing
.nr OB 1 \" BSD enhanced ulimit options
.ds OK [\|
.ds CK \|]
.TH KSH 1 "July 1992"
.SH NAME
ksh \- Bourne / Korn Shell (Public Domain)
.SH SYNOPSIS
\fBksh\fP
[\fB\-st\fP] [\fB\-c\fP \fIcommand\fP]
[\fIfile\fP [\fIargument ...\fP]]
.SH INTRODUCTION
This document only summarizes the System V, release 2 shell features.
All of the System V features except for `restricted mode'
are implemented.
See also the BUGS section.
.LP
Features of the Korn shell are described in more detail.
Only a subset of the Korn shell features are currently implemented.
.SH DESCRIPTION
.SS Command syntax
The `#' character begins a one-line comment,
unless the `#' occurs inside a word.
The tokens `;', `|', `&', `;;', `||', `&&', `(', and `)'
stand by themselves.
A \fIword\fP is a sequence of any other non-whitespace characters,
which may also contain quoted strings
(quote character are `\'', `"', `\`',
or a matching `${ }' or `$( )' pair).
A \fIname\fP is an unquoted word made up of letters, digits, or `_'.
Any number of whitespace characters (space and tab) may separate words and tokens.
.LP
In the following syntax, { ... }? indicates an optional thing,
{ ... }* indicates zero or more repetitions, { ... | ... } indicates alternatives.
.de S
.br
\\$1
.br
..
.IP statement:
.S "\fB(\fP list \fB)\fP"
.S "\fB{\fP list \fB;\fP \fB}\fP"
.S "\fBfor\fP name { \fBin\fP { word }* }? \fBdo\fP list \fB;\fP \fBdone\fP"
.S "\fBselect\fP name { \fBin\fP { word }* }? \fBdo\fP list \fB;\fP \fBdone\fP"
.S "{ \fBwhile\fP | \fBuntil\fP } list \fB;\fP \fBdo\fP list \fB;\fP \fBdone\fP"
.S "\fBif\fP list \fB;\fP \fBthen\fP list \fB;\fP { \fBelif\fP list \fB;\fP \fBthen\fP list \fB;\fP }* { \fBelse\fP list \fB;\fP }?\fBfi\fP"
.S "\fBcase\fP name \fBin\fP { \fB(\fP word { \fB|\fP word } \fB)\fP list \fB;;\fP }* \fBesac\fP"
.S "\fBfunction\fP name \fB{\fP list \fB;\fP \fB}\fP"
.S "name \fB() {\fP list \fB;\fP \fB}\fP"
.S "\fBtime\fP pipe"
The opening parenthesis of the pattern is optional.
Redirection may occur at the beginning or end of a statement.
.IP command:
.S "{ name=word }* { word }*"
Redirection may occur anywhere in a command.
.IP list:
.S "cond"
.S "cond \fB;\fP list"
.S "cond \fB&\fP list"
.IP cond:
.S "pipe"
.S "pipe \fB&&\fP cond"
.S "pipe \fB||\fP cond"
.IP pipe:
.S "statement { \fB|\fP statement }*"
.SS The select statement
The \fBselect\fP statement provides an automatic method of presenting the
user with a menu selection from several options.
The \fIwords\fP given in the list are printed on standard error, each
preceded by a number.
Typing the number on standard input sets the variable \fIname\fP to the
word that was selected.
The data that was typed is preserved in a variable called REPLY.
The contents of the loop are then executed using the selected value.
A new prompt PS3 is used to indicate that a number should be typed in
to choose a value from the menu.
.LP
Menus will continue to be presented until an interrupt is received or
end-of-file is typed on input.
.SS Alias expansion
Alias expansion occurs when the first word of a
statement is a defined alias,
except when that alias is already being expanded.
It also occurs after the expansion of an alias whose
definition ends with a space.
.SS Alternation
Csh provides a filename expansion method known as alternation.
This has been added into this version of ksh.
When performing filename substitution, you can get the shell to create
a set of strings for you. For example, `exampl{a,b,c,d,e}' will expand
to ``exampla examplb examplc exampld example''.
A comma separated set of strings in curly braces
will be expanded into a set of strings that are passed into the command.
The strings are not sorted.
.SS Shell variables
The following standard special variables exist:
\fB!\fP, \fB#\fP, \fB$\fP, \fB\-\fP, \fB?\fP.
.IP "_"
In interactive use this parameter is set to the last word of
the previous command. When a command is executed this parameter
is set to the full path of the command and placed in the environment
for the command. See also \fBMAILPATH\fP.
.IP CDPATH
The search path for the \fIcd\fP command.
.IP ENV
If this variable is set at start-up
(after any profile files are executed),
the expanded value is used as shell start-up file.
It typically contains function and alias definitions.
.IP FCEDIT
The editor used by the \fIfc\fP command.
During startup the shell checks the value of \fBFCEDIT\fP,
\fBEDITOR\fP and finally \fBVISUAL\fP to try and determine what
command line edit mode to use. Note that this is not strictly
ksh compatible behaviour.
.IP COLUMNS
The width to use for the commandline editing (emacs mode only).
.IP HISTFILE
The name of the file used to store history.
If defined, history will be loaded from this file on startup.
Also, several invocations of the shell running on the same machine
will share history if their HISTFILE variables all point at the same file.
.IP HISTSIZE
The number of commands normally stored for history, default 128.
.IP HOME
The default directory for the \fIcd\fP command.
.IP IFS
\fIInternal field separator\fP,
used during substitution and the \fIread\fP command.
.IP MAIL
If set, the user will be informed of the arrival of mail
in the named file. This variable is ignored if
the \fBMAILPATH\fP variable is set.
.IP MAILCHECK
How often, in seconds, the shell will check for mail in the
file(s) specified by \fBMAIL\fP or \fBMAILPATH\fP. If 0,
the shell checks before each prompt. The default is 600
seconds.
.IP MAILPATH
A list of files to be checked for mail. The list is colon
separated, and each file may be followed by a \fB?\fP and
a message to be printed if new mail has arrived. Command
and parameter substitution is performed on the message, and
the parameter \fB$_\fP is set to the name of the file.
The default message is `you have mail in $_'.
.IP PATH
The search path for executable commands and \fB.\fP'd files.
.IP PPID
The process number of the parent of the shell.
.IP "PS1 PS2"
\fBPS1\fP is the primary prompt for interactive shells.
Dollar substitution is performed, and \fB!\fP is replaced
with the command number (see \fIfc\fP).
.IP "PWD OLDPWD"
The current and previous working directories.
.IP RANDOM
A random integer. The random number generator may be seeded
by assigning an integer value to this variable.
.IP SECONDS
The number of seconds since the shell timer was started or
reset. Assigning an integer value to this variable resets
the timer.
.SS Substitution
In addition to the System Vr2 substitutions,
the following are available.
.IP "$(command)"
Like `command`, but no escapes are recognized.
.IP "$( Equivalent to $(cat file), but without forking.
.IP "${#var}"
The length of the string value of \fIvar\fP,
or the number of arguments if \fIvar\fP is \fB*\fP or \fB@\fP.
.IP "${var#pattern} ${var##pattern}"
If \fIpattern\fP matches the beginning of the value of \fIvar\fP,
the matched text is deleted from the result of substitution.
A single \fB#\fP results in the shortest match,
two \fB#\fP's results in the longest match.
.IP "${var%pattern} ${var%%pattern}"
Like \fB#\fP substitution, but deleting from the end of the value.
.SS Expressions
Expressions can be used with the \fBlet\fP command,
as numeric arguments to the \fBtest\fP command,
and as the value of an assignment to an integer variable.
.LP
Expression may contain alpha-numeric variable identifiers and integer constants
and may be combined with the following operators:
.IP "== != <= < > >= + - * / % ! ( )"
.SS Command execution
After evaluation of keyword assignments and arguments,
the type of command is determined.
A command may execute a shell function, a shell built-in,
or an executable file.
.LP
Any keyword assignments are then performed according to
the type of command.
In function calls assignments are local to the function.
Assignments in built-in commands marked with a \(dg persist,
otherwise they are temporary.
Assignments in executable commands are exported to the sub-process
executing the command.
.LP
Even on systems where the exec() family does not support #!
notation for scripts, ksh can be configured to fake it.
.LP
There are several built-in commands.
.IP ":"
Only expansion and assignment are performed.
This is the default if a command has no arguments.
.IP ". \fIfile\fP"
Execute the commands in \fIfile\fP without forking.
The file is searched in the directories of $PATH.
Passing arguments is not implemented.
.IP "alias [\fIname\fB=\fIvalue\fI ...]\fR"
Without arguments, \fBalias\fP lists all aliases and their values.
For any name without a value, its value is listed.
Any name with a value defines an alias, see "Alias Expansion" above.
Korn's tracked aliases are not implemented,
but System V command hashing is (see "hash").
.IP "alias -d [\fIname\fB=\fIvalue\fI ...]\fR"
Directory aliases for tilde expansion, eg.
.br
alias -d fac=/usr/local/usr/facilities
.br
cd ~fac/bin
.IP "break [\fIlevels\fP]"
.IP "builtin \fIcommand arg ...\fP"
\fICommand\fP is executed as a built-in command.
.IP "cd [\fIpath\fP]"
Set the working directory to \fIpath\fP. If the parameter
CDPATH is set, it lists the search path for the directory
containing \fIpath\fP. A null path means the current directory.
If \fIpath\fP is missing, the home directory ($HOME) is used.
If \fIpath\fP is \fB\-\fP, the previous working directory is used.
If \fIpath\fP is \fB..\fP, the shell changes directory to the
parent directory, as determined from the value of PWD.
The PWD and OLDPWD variables are reset.
.IP "cd \fIold new\fP"
The string \fInew\fP is substituted for \fIold\fP in the current
directory, and the shell attempts to change to the new directory.
.IP "continue [\fIlevels\fP]"
.IP "echo ..."
\fIEcho\fP is replaced with the alias echo='print' in the Korn shell.
.IP "eval \fIcommand ...\fP"
.IP "exec \fIcommand arg ...\fP"
The executable command is executed without forking.
If no arguments are given, any IO redirection is permanent.
.IP "exit [\fIstatus\fP]"
.IP "fc [\fB\-e\fP \fIeditor\fP] [\fB\-lnr\fP] [\fIfirst\fP [\fIlast\fP]]"
\fIFirst\fP and \fIlast\fP select commands.
Commands can be selected by history number,
or a string specifying the most recent command starting with that string.
The \fB\-l\fP option lists the command on stdout,
and \fB\-n\fP inhibits the default command numbers.
The \fB\-r\fP option reverses the order of the list.
Without \fB\-l\fP, the selected commands can be edited by
the editor specified with the \fB\-e\fP option, or if no \fB\-e\fP
is specified,
the \fB$FCEDIT\fP editor, then executed by the shell.
.IP "fc \fB\-e \-\fP [\fB\-g\fP] [\fIold\fB=\fInew\fR] [\fIcommand\fP]"
Re-execute the selected command (the previous command by default)
after performing the optional substitution of \fIold\fP with \fInew\fP.
If \fB\-g\fP is specified, all occurrences of \fIold\fP are
replaced with \fInew\fP.
This command is usually accessed with the predefined alias
r=`fc \-e \-'.
.IP "getopts"
See the attached manual page.
.IP "hash [\fB\-r\fP] [\fIname ...\fP]"
Without arguments, any hashed executable command pathnames are listed.
The \fB\-r\fP flag causes all hashed commands to be removed.
Each \fIname\fP is searched as if it were a command name
and added to the hash table if it is an executable command.
.IP "kill [\fB\-\fIsignal\fR] \fIprocess\fP ..."
Send a signal (TERM by default) to the named process.
The signal may be specified as a number or a mnemonic from
with the SIG prefix removed.
.IP "let [\fIexpression ...\fP]"
Each expression is evaluated, see "Expressions" above.
A zero status is returned if the last expression evaluates
to a non-zero value, otherwise a non-zero status is returned.
Since may expressions need to be quoted, \fI(( expr ))\fP is
syntactic sugar for \fIlet "expr"\fP.
.IP "print [\fB\-nreu\fIn\fR] [\fIargument ...\fP]"
\fBPrint\fP prints its arguments on the standard output,
separated by spaces, and terminated with a newline.
The \fB\-n\fP option eliminates the newline.
.IP
By default, certain C escapes are translated.
These include \eb, \ef, \en, \er, \et, \ev, and \e### (# is an octal digit).
\ec is equivalent to the \fB\-n\fP option.
This expansion may be inhibitted with the \fB\-r\fP option,
and may be re-enabled with the addition of the \fB\-e\fP option.
.IP "read [\fB\-ru\fIn\fR] \fIname ...\fP"
The first variable name may be of the form \fIname\fB?\fIprompt\fR.
.IP "readonly [\fIname ...\fP]"
.IP "return [\fIstatus\fP]"
.ta 5n 10n 30n
.de O
.br
\\$1 \\$2 \\$3
..
.IP "set [\fB\(+-\fP\fI[a-z]\fP] [\fB\(+-o\fP \fIkeyword\fP] ..."
Set (\fB\-\fP) or clear (\fB+\fP) a shell option:
.O \-a allexport "all new variable are created with export attribute"
.O \-e errexit "exit on non-zero status [incorrect]"
.O "" bgnice "background jobs are run with lower priority"
.if \n(OE \{
.O "" emacs "BRL emacs-like line editing"\}
.O "" ignoreeof "shell will not exit of EOF, must use \fIexit\fP"
.O \-k keyword "variable assignments are recognized anywhere in command"
.O "" markdirs "[not implemented]"
.O \-m monitor "job control enabled (default for interactive shell)"
.O \-n noexec "compile input but do not execute (ignored if interactive)"
.O \-f noglob "don't expand filenames"
.O \-u nounset "dollar expansion of unset variables is an error"
.O \-v verbose "echo shell commands on stdout when compiling"
.O \-h trackall "add command pathnames to hash table"
.O "" vi "VI-like line editing"
.O \-x xtrace "echo simple commands while executing"
.IP "set [\fB\-\-\fP] \fIarg ...\fP"
Set shell arguments.
.IP "shift [\fInumber\fP]"
.IP "test"
See the attached manual page.
.IP "times"
.IP "trap [\fIhandler\fP] [\fIsignal ...\fP]"
.IP "typeset [\fB\(+-irtx\fP] [\fIname\fP[\fB=\fIvalue\fR] ...]"
If no arguments are given, lists all variables and their attributes.
.PP
If options but no names are given, lists variables with specified
attributes, and their values if unless `+' is used.
.PP
If names are given, set the attributes of the named variables.
Variables may also be assigned a value.
If used inside a function, the created variable are local to the function.
.PP
The attributes are as follows.
.ta 5n 10n
\-i The variable's value is stored as an integer.
.br
\-x The variable is exported to the environment.
.br
\-r The variable is read-only cannot be reassigned a value.
.br
\-t Trace (not implemented).
.br
\-f List functions instead of variable.
.\".IP "ulimit [\fB\-f\fP] [\fIvalue\fP]"
.ds OZ
.IP "\fBulimit\fP \*(OK \fB\-\*(OZ\fP \*(CK \*(OK \fIn\fP \*(CK"
.RS
.TP "\w'\fB\-\- 'u"
.if \n(OB \{.B \-c
Impose a size limit of
.I n\^
blocks on the size of core dumps.
.TP
.B \-d
Impose a size limit of
.I n\^
blocks on the size of the data area.\}
.TP
.B \-f
Impose a size limit of
.I n
blocks on files written by the shell
and its child processes (files of any size may be read).
.if \n(OB \{.TP
.B \-m
Impose a soft limit of
.I n\^
blocks on the size of physical memory.
.TP
.B \-t
Impose a time limit of
.I n\^
seconds to be used by each process.\}
.PP
If no option is given,
.B \-f
is assumed.
If
.I n
is omitted, the current limit is printed.
As far as
.B ulimit
is concerned, a `block' is 512 bytes.
.PP
You may lower your own resource limit,
but only a super-user (see
.IR su (1M))
can raise a limit.
.RE
.IP "umask [\fIvalue\fP]"
.IP "unalias \fIname ...\fP"
The aliases for the given names are removed.
.IP "unset [\fB\-f\fP] \fIname ...\fP"
.IP "wait [\fIprocess-id\fP]"
.IP "whence [\fB\-v\fP] name ..."
For each name, the type of command is listed.
The \fB\-v\fP flag causes function and alias values to be listed.
.SS Job Control
Job control features are enabled by the
\fB\-m\fP or \fB\-o monitor\fP flags.
When job control is enabled, and the system supports job control,
background commands and foreground commands that have been stopped
(usually by a
.SM SIGTSTP
signal generated by typing
.IR ^Z\^ )
are placed into separate individual

.IR "process groups" .
The following commands are used to manipulate these process groups:
.PP
.PD 0
.TP "\w'\fBkill\fP \*(OK \fIjob\fP \*(CK 'u"
\fBjobs\fP
Display information about the controlled jobs.
The job number is given preceeded by a percent sign,
followed by a plus sign if it is the `current job',
or by a minus sign if it is the `previous job',
then the process group number for the job,
then the command.
.TP
\fBkill\fP [\fB\-\fIsignal\fR] \fIjob\fP ...
Send a signal (TERM by default) to the named job process group.
.TP
\fBfg\fP \*(OK \fIjob\fP \*(CK
Resume the stopped foreground job in the foreground.
If the process group
.I n
is not specified then the `current job' is resumed.
.TP
\fBbg\fP \*(OK \fIjob\fP \*(CK
Resume the stopped foreground job in the background.
If the process group
.I n
is not specified then the `current job' is resumed.
.PD
.PP
The \fBfg\fP, \fBbg\fP, \fBkill\fP, and \fBwait\fP commands
may refer to jobs with the following `percent' sequences.
The percent sign is optional with the fg and bg commands.
.PP
.PD 0
.TP "\w'\fBbg\fP \*(OK \fIn\fP \*(CK 'u"
.BR %+ ( %\- )
If there is a `current job' (`previous job'),
then that job is selected.
.TP
.BI % n
If the specified job number is one of the known jobs,
then that job is selected.
.TP
.BI % string
If the string matches the initial part of a job's command,
then that job is selected.
.TP
.BI %? string
As above, but the string may match any portion of the command.
.sp
.PP
If the system does not support job control, monitor mode enables
job reporting. The jobs and kill commands
functions as above, and you will
be informed when background jobs complete. Fg and bg are not
available.
.PD
.br
.SS "Interactive Input Line Editing"
When the
.B emacs
option is set,
interactive input line editing is enabled.
This mode is slightly different from the emacs mode in AT&T's KornShell.
In this mode various
.I "editing commands"
(typically bound to one or more control characters)
cause immediate actions without waiting for a new-line.
Several
.I "editing commands"
are bound to particular control characters
when the shell is invoked;
these bindings can be changed using the following commands:
.br
.PP
.PD 0
.TP 2i
\fBbind\fP
The current bindings are listed.
.TP
\fBbind\fP \*(OK \fIstring\fP \*(CK = \*(OK \fIediting-command\fP \*(CK
The specified
.I "editing command\^"
is bound to the given
.IR string ,
which should consist of a control character
(which may be written using `caret notation' \fB^\fP\fIx\fP\|),
optionally preceded by one of the two prefix characters.
Future input of the
.I string
will cause the
.I "editing command\^"
to be immediately invoked.
.br
Note that although only two prefix characters (normal ESC and ^X)
are supported, some multi-character sequences can be supported:
.br
bind '^[['=prefix-2
.br
bind '^XA'=up-history
.br
bind '^XB'=down-history
.br
bind '^XC'=forward-char
.br
bind '^XD'=backward-char
.br
will bind the arrow keys on an ANSI terminal, or xterm. Of course some escape
sequences won't work out quite that nicely.
.TP
\fBbind -m\fP \*(OK \fIstring\fP \*(CK = \*(OK \fIsubstitute\fP \*(CK
The specified input
.I string
will afterwards be immediately replaced by the given
.I substitute
string,
which may contain
.IR "editing commands" .
.PD
.PP
The following
.I "editing commands"
are available;
first the command name is given
followed by its default binding (if any)
using caret notation
(note that the ASCII
.SM ESC
character is written as \s-1^[\s0\|),
then the editing function performed is described.
Note that
.I "editing command"
names are used only with the
.B bind
command.
Furthermore,
many
.I "editing commands"
are useful only on terminals with a visible cursor.
The default bindings were chosen to resemble corresponding EMACS key bindings.
The users tty characters (eg. erase) are bound to reasonable
substitutes.
.br
.PP
.PD 0
.TP "\w'\fBdelete-word-backward ^[\|ERASE\fP 'u"
\fBabort ^G\fP
Useful as a response to a request for a
.B search-history
pattern in order to abort the search.
.br
.TP
\fBauto-insert\fP
Simply causes the character to appear as literal input.
(Most ordinary characters are bound to this.)
.br
.TP
\fBbackward-char ^B\fP
Moves the cursor backward one character.
.br
.TP
\fBbackward-word ^[\|b\fP
Moves the cursor backward to the beginning of a word.
.br
.TP
\fBbeginning-of-line ^A\fP
Moves the cursor to the beginning of the input line
(after the prompt string).
.br
.TP
\fBcomplete ^[\|^[\fP
Automatically completes as much as is unique of the hashed command name
or the file name containing the cursor.
If the entire remaining command or file name is unique
a space is printed after its completion,
unless it is a directory name in which case
.B /
is postpended.
If there is no hashed command or file name with the current partial word
as its prefix,
a bell character is output (usually causing a `beep').
.br
.TP
\fBcomplete-command ^X^[\fP
Automatically completes as much as is unique of the hashed command name
having the partial word up to the cursor as its prefix,
as in the
.B complete
command described above.
Only command and function names seen since the last
.B "hash \-r"
command are available for completion;
the
.B "hash"
command may be used to register additional names.
.br
.TP
\fBcomplete-file ^[\|^X\fP
Automatically completes as much as is unique of the file name
having the partial word up to the cursor as its prefix,
as in the
.B complete
command described above.
.br
.TP
\fBcopy-last-arg ^[\|_\fP
The last word of the previous command is inserted at the
cursor. Note I/O redirections do not count as words of
the command.
.br
.TP
\fBdelete-char-backward ERASE\fP
Deletes the character before the cursor.
.br
.TP
\fBdelete-char-forward\fP
Deletes the character after the cursor.
.br
.TP
\fBdelete-word-backward ^[\|ERASE\fP
Deletes characters before the cursor back to the beginning of a word.
.br
.TP
\fBdelete-word-forward ^[\|d\fP
Deletes characters after the cursor up to the end of a word.
.br
.TP
\fBdown-history ^N\fP
Scrolls the history buffer forward one line (later).
Each input line originally starts just after
the last entry in the history buffer,
so
.B down-history
is not useful until either
.B search-history
or
.B up-history
has been performed.
.br
.TP
\fBend-of-line ^E\fP
Moves the cursor to the end of the input line.
.br
.TP
\fBeot ^_\fP
Acts as an end-of-file;
this is useful because edit-mode input
disables normal terminal input canonicalization.
.br
.TP
\fBeot-or-delete ^D\fP
Acts as eot if alone on a line;
otherwise acts as delete-char-forward.
.br
.TP
\fBexchange-point-and-mark ^X\|^X\fP
Places the cursor where the mark is, and sets the
mark to where the cursor was.
.br
.TP
\fBforward-char ^F\fP
Moves the cursor forward one position.
.br
.TP
\fBforward-word ^[\|f\fP
Moves the cursor forward to the end of a word.
.br
.TP
\fBkill-line KILL\fP
Deletes the entire input line.
.br
.TP
\fBkill-to-eol ^K\fP
Deletes the input from the cursor to the end of the line.
.br
.TP
\fBkill-region ^W\fP
Deletes the input between the cursor and the mark.
.br
.TP
\fBlist ^[\|?\fP
Prints a sorted, columnated list of hashed command names or file names
(if any) that can complete the partial word containing the cursor.
Directory names have
.B /
postpended to them,
and executable file names are followed by
.BR \(** .
.br
.TP
\fBlist-command ^X\|?\fP
Prints a sorted, columnated list of hashed command names
(if any) that can complete the partial word containing the cursor.
.br
.TP
\fBlist-file\fP
Prints a sorted, columnated list of file names
(if any) that can complete the partial word containing the cursor.
File type indicators are postpended as described under
.B list
above.
.br
.TP
\fBnewline ^J \fP\fIand\^\fP\fB ^M\fP
Causes the current input line to be processed by the shell.
(The current cursor position may be anywhere on the line.)
.br
.TP
\fBnewline-and-next ^O\fP
Causes the current input line to be processed by the shell, and
the next line from history becomes the current line. This is
only useful after an up-history or search-history.
.br
.TP
\fBno-op QUIT\fP
Does nothing.
.br
.TP
\fBprefix-1 ^[\fP
Introduces a 2-character command sequence.
.br
.TP
\fBprefix-2 ^X\fP
Introduces a 2-character command sequence.
.br
.TP
\fBquote ^^\fP
The following character is taken literally
rather than as an
.IR "editing command" .
.br
.TP
\fBredraw ^L\fP
Reprints the prompt string and the current input line.
.br
.TP
\fBsearch-character ^]\fP
Search forward in the current line for the next keyboard character.
.br
.TP
\fBsearch-history ^R\fP
Enter incremental search mode.
The internal history list is searched backwards for commands matching the input.
An initial `^' in the search string anchors the search.
The escape key will leave search mode.
Other commands will be executed after leaving search mode (unless
of course they are prefixed by escape, in which case they will
almost certainly do the wrong thing).
Successive
.B search-history
commands continue searching backward
to the next previous occurrence of the pattern.
The history buffer retains only a finite number of lines;
the oldest are discarded as necessary.
.br
.TP
\fBset-mark-command ^]\|\fP
Search forward in the current line for the next keyboard character.
.br
.ie \n(OX \{.TP
\fBstuff ^T\fP\}
.el \{.TP
\fBstuff\fP\}
On systems supporting it,
pushes the bound character back onto the terminal input
where it may receive special processing by the terminal handler.
.if \n(OX \{This is useful for the BRL
.B ^T
`mini-systat' feature,
for example.\}
.br
.TP
\fBstuff-reset\fP
Acts like
.BR stuff\^ ,
then aborts input the same as an interrupt.
.br
.ie \n(OX \{.TP
\fBtranspose-chars\fP\}
.el \{.TP
\fBtranspose-chars ^T\fP\}
Exchanges the two characters on either side of the cursor, or
the two previous characters if the cursor is at end of line.
.br
.TP
\fBup-history ^P\fP
Scrolls the history buffer backward one line (earlier).
.br
.TP
\fByank ^Y\fP
Inserts the most recently killed text string at the current cursor position.
.br
.TP
\fByank-pop ^[\|y\fP
Immediately after a
.BR yank ,
replaces the inserted text string with the
next previous killed text string.
.PD
.br
.SH FILES
~/.profile
.br
/etc/profile
.SH SEE ALSO
Sh(1) on System V or Sun OS.
.LP
.I "UNIX Shell Programming,"
Stephan G. Kochan,
Patrick H. Wood,
Hayden.
.LP
.I "KornShell: Command and Programming Language (not yet published),"
Morris Bolsky and David Korn.
.SH AUTHORS
Based on the public domain 7th edition Bourne shell.
.LP
System V and Korn modifications by Eric Gisin,
with contributions by
Ron Natalie, Arnold Robbins, Doug Gwyn, Erik Baalbergen, AT&T (getopt(3)),
John McMillan, Simon Gerraty and Peter Collinson.
.SH DIFFERENCES FROM AT&T VERSION
Csh-style alternations are implemented.

Variable arrays are not implemented.
Variable attributes other than integer are not implemented.
The \fBERR\fP and \fBEXIT\fP traps are not implemented for functions.
Alias expansion is inhibited at the beginning of an alias definition
in the AT&T version.
Korn evaluates expressions differently [elaborate].
.SH BUGS
Interactive shells may occasionally hang while waiting for a job
in the BSD version.
.LP
The 8th bit is stripped in emacs mode.
.LP
Quoting double-quote (") characters inside back-quote (`) inside
double-quotes does not behave properly. Why are you doing this?
.LP
The emacs mode can `lose' stty command done by the user.
.LP
Unsetting special variables
may cause unexpected results.
.LP
Functions declared as having local scope really have global scope.
.LP
Here documents inside functions do not work correctly.
.LP
Exit on error (\fBset \-e\fP or \fBset -o errexit\fP) does not work
correctly.


  3 Responses to “Category : OS/2 Files
Archive   : KSH48.ZIP
Filename : KSH.1

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/