by Eric Gisin
ksh is a command interpreter that is intended for both interactive and shell script use. Its command language is a superset of the sh(1) shell language.
Shell Startup
The following options can be specified only on the command line:
-c command-string
the shell executes the command(s) contained in command-string
-c command-string
the shell executes the command(s) contained in command-string
-i
interactive mode - see below
interactive mode - see below
-l
login shell - see below interactive mode - see below
login shell - see below interactive mode - see below
-s
the shell reads commands from standard input; all non-option arguments are positional parameters
the shell reads commands from standard input; all non-option arguments are positional parameters
-r
restricted mode - see below
restricted mode - see below
In addition to the above, the options described in the set built-in command can also be used on the command line.
If neither the -c nor the -s options are specified, the first non-option argument specifies the name of a file the shell reads commands from; if there are no non-option arguments, the shell reads commands from standard input. The name of the shell (i.e., the contents of the $0) parameter is determined as follows: if the -c option is used and there is a non-option argument, it is used as the name; if commands are being read from a file, the file is used as the name; otherwise the name the shell was called with (i.e., argv[0]) is used.
A shell is interactive if the -i option is used or if both standard input and standard error are attached to a tty. An interactive shell has job control enabled (if available), ignores the INT, QUIT and TERM signals, and prints prompts before reading input (see PS1 and PS2 parameters). For non-interactive shells, the trackall option is on by default (see set command below).