$BatchInput

$BatchInput

is True if input in the current session is being fed directly to the Wolfram Language kernel in batch mode.

Details

  • $BatchInput is True if input is being taken from a file.
  • $BatchInput can be reset during a Wolfram System session.
  • When $BatchInput is True, the Wolfram System terminates if it ever receives an interrupt, does not discard input when blank lines are given, and terminates when it receives endoffile.

Examples

Basic Examples  (2)

In an interactive session, $BatchInput is False by default:

Run a standalone Wolfram Language kernel with an input file:

Put commands in a file, in this case to evaluate $BatchInput:

Run the command. The session terminates at the end of the file:

The output file contains the value of $BatchInput:

Delete the temporary files:

Introduced in 1991
 (2.0)