WolframScript introduces a wide variety of command-line interactions to best fit your scripting needs.

Run Code on the Command Line

Code can be passed to WolframScript directly on the command line with the -code argument, allowing the user to immediately display or redirect the output into a file.

Run Code from a File

Code can be run directly from Wolfram Language packages using the -file argument.

Create Executable Scripts

WolframScript can be used as a script interpreter, allowing for scripts to be written with the Unix #! syntax on systems where this is supported.

Run Functions from the Command Line

Pure functions can be defined and executed using data and arguments from the command-line environment, allowing for easy ad-hoc sequential operations.

Simple Interaction with Input Streams

Data streamed into WolframScript is captured into the $ScriptInputString symbol for easy processing of data either all at once or iteratively line by line.