Wolfram Language & System 10.4 (2016)|Legacy Documentation
This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)
is an interpreter for standalone executable Wolfram Language scripts.
- interpreter allows running standalone executable scripts written using the Wolfram Language.
- sets up the environment and then launches the Wolfram Language kernel in a special mode.
- Scripts using follow the standard Unix script convention: the first line of the file consists of the "#!" characters, followed by the absolute path to the interpreter, followed by other parameters.
- The absolute path to the interpreter cannot contain spaces when given in the first line of the script.
- The absolute path to the file, which is a symbolic link to , is acceptable as the path to the interpreter.
- The first line of the script must contain the -script option, which must be the last option on the line.
- The first line of the script is ignored by the kernel when the script is executed.
- Parameters given on the first line of the script are by default considered as options to the Wolfram Language kernel.
- The rest of the script file may contain arbitrary Wolfram Language commands, which are evaluated sequentially.
- The script file name and its arguments are accessible from within the script as $ScriptCommandLine.
- The standard input and output channels , , and are not redirected, so that the script can be used in a pipe with other processes.
- When the script is run, the Wolfram Language kernel prints no banner, no In or Out labels, and generates all output in InputForm, with the PageWidth option effectively set to Infinity.
- Each of the Wolfram Language scripts running concurrently starts its own kernel, with no shared variables or definitions. The number of the Wolfram Language scripts running in parallel may be subject to licensing limitation.
- When all Wolfram Language expressions in the script are evaluated, the kernel terminates.