Wolfram System Sessions

CommandLine Options and Environment Variables

-pwfileWolfram System password file
-pwpathpath to search for a Wolfram System password file
-runWolfram Language input to run (kernel only)
-initfileWolfram System initialization file
-initpathpath to search for initialization files
-noinitdo not run initialization files
-wstpcommunicate only via WSTP

Typical commandline options for Wolfram System executables.

If the Wolfram System front end is called with a notebook file as a commandline argument, then this notebook will be made the initial selected notebook. Otherwise, a new notebook will be created for this purpose.

Wolfram Language kernels and front ends can also take additional commandline options specific to particular window environments.

MATHINITcommandline environment for the Wolfram System front end
MATHKERNELINITcommandline environment for the Wolfram Language kernel
MATHEMATICA_BASEsetting for $BaseDirectory
MATHEMATICA_USERBASEsetting for $UserBaseDirectory

Environment variables.

The Wolfram System will read the values of operating system environment variables, and will use these values in addition to any command-line options explicitly given.


On startup, the Wolfram Language kernel does the following:

The Main Loop

All Wolfram System sessions repeatedly execute the following main loop:

Note that if you call the Wolfram Language via the Wolfram Symbolic Transfer Protocol (WSTP) from within an external program, then you must effectively create your own main loop, which will usually differ from the one described above.


During a Wolfram System session messages can be generated either by explicit calls to Message, or in the course of executing other builtin functions.

f::name::langa message in a specific language
f::namea message in a default language
General::namea general message with a given name

Message names.

If no language is specified for a particular message, text for the message is sought in each of the languages specified by $Language. If f::name is not defined, a definition for General::name is sought. If still no message is found, any value defined for $NewMessage is applied to Null and "name".

Quiet[expr] evaluates expr while preventing messages from being printed during the evaluation. Off[message] prevents a specified message from ever being printed. Check allows you to determine whether particular messages were generated during the evaluation of an expression. $MessageList and MessageList[n] record all the messages that were generated during the evaluation of a particular line in a Wolfram System session.

Messages are specified as strings to be used as the first argument of StringForm. $MessagePrePrint is applied to each expression to be spliced into the string.


Exit[] or Quit[]terminate the Wolfram System
$Epilogsymbol to evaluate before the Wolfram System exits
$IgnoreEOFwhether to exit an interactive Wolfram System session when an endoffile character is received
end.mfile to read when the Wolfram System terminates

Wolfram System termination.

There are several ways to end a Wolfram System session. If you are using the Wolfram System interactively, typing Exit[] or Quit[] on an input line will always terminate the Wolfram System.

If you are taking input for the Wolfram Language from a file, the Wolfram System will exit when it reaches the end of the file. If you are using the Wolfram System interactively, it will still exit if it receives an endoffile character (typically Ctrl+d). You can stop the Wolfram System from doing this by setting $IgnoreEOF=True.

Network License Management

single-machine licensea process must always run on a specific machine
network licensea process can run on any machine on a network

Singlemachine and network licenses.

Copies of the Wolfram System can be set up with either singlemachine or network licenses. A network license is indicated by a line in the mathpass file starting with !name, where name is the name of the server machine for the network license.

Network licenses are controlled by the Wolfram System license management program mathlm, which is run on the server machine. This program must be running whenever a Wolfram System with a network license is being used. Typically you will want to set up your system so that mathlm is started whenever the system boots.

Type .mathlm directly on the command line
Add mathlm as a Windows service

Ways to start the network license manager under Microsoft Windows.

Type ./mathlm directly on the Unix command line
Add a line to start mathlm in your central system startup script

Ways to start the network license manager on Macintosh and Linux systems.

When mathlm is not started directly from a command line, it normally sets itself up as a background process, and continues running until it is explicitly terminated. Note that if one mathlm process is running, any other mathlm processes you try to start will automatically exit immediately.

-logfile filewrite a log of license server actions to file
-loglevel nhow verbose to make log entries (1 to 4)
-logformat stringuse a log format specified by string
-language namelanguage to use for messages (default English)
-pwfile fileuse the specified mathpass file (default ./mathpass)
-timeout nsuspend authorization on stopped Wolfram System jobs after n hours
-restrict fileuse the specified restriction file
-mathidprint the MathID for the license server, then exit
-foregroundrun mathlm in the foreground, logging to stdout
-installinstall mathlm as a Windows service (Microsoft Windows only)
-uninstalluninstall mathlm as a Windows service (Microsoft Windows only)

Some commandline options for mathlm.

For more detailed information on mathlm, see "Mathematica System Administration".

monitorlma program to monitor network license activity
monitorlm namemonitor activity for license server name

Monitoring network license activity.

If monitorlm is run in an environment where a web browser can be started, it will automatically generate HTML output in the browser. Otherwise it will generate plain text.

-file filewrite output to a file
-format specuse the specified format (text, html, or cgi)
-template fileuse the specified file as a template for the output

Some commandline options for monitorlm.