exit terminates the KornShell. If there is an expression, the value of the expression is the exit status of the shell.
On a POSIX-compliant system, the value of expression should be between 0 and 255. The exit command raises the EXIT trap, unless exit is being invoked inside an EXIT trap.
exit returns the value of the arithmetic expression to the parent process as the exit status of the shell. If you omit expression, it returns the exit status of the last command executed.
POSIX.2. x/OPEN Portability Guide 4.0. All UNIX systems. Windows 2000. Windows XP. Windows Server 2003. Windows Vista. Windows 7. Windows Server 2008. Windows 8. Windows Server 2012.
Allowing an expression rather than just a number is an extension found in the KornShell.
This is a special built-in command of the MKS KornShell. The exit command provided with MKS Toolkit should not be confused with the internal exit command on Windows systems.
MKS Toolkit for Power Users
MKS Toolkit for System Administrators
MKS Toolkit for Developers
MKS Toolkit for Interoperability
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
MKS Toolkit 9.5 Documentation Build 3.