Appendix B. Reference Information

This appendix contains reference lists for invocation options, built-in commands and keywords, predefined aliases, built-in shell variables, test operators, shell options, typeset options, arithmetic, emacs-mode commands, and vi-mode control commands. Furthermore, it describes how to use the full facilities of the built-in getopts command.

Invocation Options

Here is a list of the options you can use when invoking the Korn shell. In addition to these, any set option can be used on the command line; see the table on options later in this appendix. Login shells are usually invoked with the options -i (interactive), -s (read from standard input), and -m (enable job control).

OptionMeaning
-c string Execute string, then exit.
-D

Print all $"..." strings in the script. This is for use in creating a database of locale-specific translations of strings in a script.

-i Interactive shell. Ignore signals TERM, INTR, and QUIT.
-r Restricted shell. See Chapter 10.
-R filename

Create a cross-reference database for variable and command definitions in filename. May not be compiled in.

-s

Read commands from the standard input. If an argument is given, this flag takes precedence (i.e., the argument won’t be treated as a script name and standard input will be read).

Built-in Commands and Keywords

Here is a summary of all built-in commands and keywords.

NameCommand/keywordChapterSummary
! Keyword5Invert the true/false result of the following pipeline. ...

Get Learning the Korn Shell, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.