Previous Table of Contents Next


Arithmetic Operators

unary minus
! logical negation
~ bitwise negation
*, /, % multiplication, division, remainder (modulo)
+, – addition, subtraction
<<, >> left shift, right shift
<=, < less than or equal to, less than
>=, > greater than or equal to, greater than
==, != equal to, not equal to
& bitwise AND
^ bitwise exclusive OR
| bitwise OR
&& logical AND
|| logical OR
= assignment
*=, /=, %= multiply assign, divide assign, modulo assign
+=, –= increment, decrement
<<=, >>= left shift assign, right shift assign
&=, ^=, |= bitwise AND assign, bitwise exclusive OR assign, bitwise OR assign
(...) grouping (used to override precedence rules)

OPTIONS

The Korn shell has a number of options that specify your environment and control execution. They can be enabled/disabled with the set command or on the ksh command line.

Enabling/Disabling Options

ksh [–/+options] enable/disable the specified options
set [–/+options] enable/disable the specified options

List of Options

–a automatically export variables that are defined
–b execute all background jobs at a lower priority
–c cmds read and execute cmds (w/ksh only)
–e execute ERR trap (if set) on non-zero exit status from any commands
–f disable file name expansion
–h make commands tracked aliases when first encountered
–i execute in interactive mode (w/ksh only)
–k put variable assignment arguments in environment
–m enable job control (system dependent)
–n read commands without executing them
–o allexport automatically export variables that are defined
–o bgnice execute all background jobs at a lower priority
–o emacs use emacs-style editor for in-line editing
–o errexit execute ERR trap (if set) on non-zero exit status from any commands
–o gmacs use gmacs-style editor for in-line editing
–o ignoreeof do not exit on end of file (default Ctl-d); use exit
–o keyword put variable assignment arguments in the environment
–o markdirs display trailing / on directory names resulting from file name substitution
–o monitor enable job control (system dependent)
–o noclobber prevent I/O redirection from truncating existing files
–o noexec read commands without executing them
–o noglob disable file name expansion
–o nolog do not save function definitions in history file
–o nounset return error on substitution of unset variables
–o privileged disable processing of $HOME/.profile, and use /etc/suid_profile instead of ENV file
–o trackall make commands tracked aliases when first encountered
–o verbose display input lines as they are read
–o vi use vi-style editor for in-line editing
–o viraw process each character as it is typed in vi mode
–o xtrace display commands and arguments as executed
–p disable processing of $HOME/.profile, and use /etc/suid_profile instead of ENV file
–r run a restricted shell (w/ksh only)
–s read commands from standard input (w/ksh only)
–t exit after reading and executing one command
–u return error on substitution of unset variables
–v display input lines as they are read
–x display commands and arguments as executed
disable –v and –x flags; don't process remaining flags

ALIASES

Aliases are command macros and are used as shorthand for other commands, especially frequently-used ones.

Alias Commands

alias display a list of aliases and their values
alias name display the value for alias name
alias name='value' create an alias name set to value
alias –t display a list of tracked aliases
alias –t name='value' create a tracked alias name set to value
alias –x display a list of exported aliases
alias –x name='value' create an exported alias name set to value
unalias name remove the alias name


Previous Table of Contents Next
1