Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
User Commands (k - l) ksh(1)
NAME
ksh - OSS shell
SYNOPSIS
ksh [-i][-c command_string | -s][+ | -abCefmnosuvx][+ | -o][option ...] | [argument ...] |
[file][argument ...]
The OSS shell is an interactive command interpreter and a command programming language.
The OSS shell is based on the UNIX Korn shell.
FLAGS
-c command_string
Causes ksh to read commands from command_string.
-i Causes ksh to run as an interactive shell. The SIGTERM signal is thus ignored, and
the SIGINT signal is caught, causing the current command to be terminated and a new
prompt to be output.
-r Causes ksh to run as a restricted shell.
-s Causes ksh to read commands from standard input. If you do not specify the -c flag or
do not specify any arguments to ksh other than flags, ksh automatically invokes the -s
flag. The -c flag overrides the -s flag, however.
The rest of the flags that can be used with ksh are described under the set subcommand, in the
subsection Special ksh Commands.
DESCRIPTION
ksh is an alias for sh.
The OSS shell carries out commands either interactively from a terminal keyboard or from a file.
Some important features of the OSS shell are as follows:
• Command aliasing
• Filename substitution
• Tilde substitution
• Command substitution
• Parameter substitution
• Job control
• Inline editing
A file from which the shell carries out commands is usually called a shell script,ashell pro-
cedure,oracommand file.
A simple command is a sequence of words separated by spaces or tabs. A word is a sequence of
characters that contains no unquoted spaces or tabs. The first word in the sequence (numbered as
0) usually specifies the name of a command. Any remaining words, with a few exceptions, are
passed to that command. A space refers to both spaces and tabs.
The value of a simple command is its exit value if it ends normally or (octal) 200 added to the
signal number if it terminates due to a signal. For a list of status values, see the signal() system
call.
A pipeline is a sequence of one or more commands separated by a | (vertical bar). In a pipeline,
the standard output of each command becomes the standard input of the next command. Each
527188-003 Hewlett-Packard Company 5−7