Shell startup

You can start the Korn shell with the ksh command, psh command (POSIX shell), or the exec command.

If the shell is started by the exec command, and the first character of zero argument ($0) is the hyphen (-), then the shell is assumed to be a login shell. The shell first reads commands from the /etc/profile file and then from either the .profile file in the current directory or from the $HOME/.profile file, if either file exists. Next, the shell reads commands from the file named by performing parameter substitution on the value of the ENV environment variable, if the file exists.

If you specify the File [Parameter] parameter when invoking the Korn shell or POSIX shell, the shell runs the script file identified by the File parameter, including any parameters specified. The script file specified must have read permission; any setuid and setgid settings are ignored. The shell then reads the commands.

Note: Do not specify a script file with the -c or -s flags when invoking the Korn shell or POSIX shell.

For more information on positional parameters, see Parameters in the Korn shell.