User Reference:BCI2000Shell

From BCI2000 Wiki
Jump to navigation Jump to search

BCI2000Shell is a command line program that executes BCI2000 Operator Scripts in batch mode, or interactively. BCI2000Shell does not interpret these commands by itself. Rather, it connects to the BCI2000 Operator module.

Command line arguments

BCI2000Shell accepts the following options:

  • -c Executes the remainder of the command line as an Operator Scripting command.
  • -i Enforces interactive mode.
  • -h Displays Operator Scripting help.

When invoked without options, the first argument is taken to be the name of a BCI2000 script to execute, with remaining arguments being arguments to the script. When invoked without arguments, BCI2000Shell runs in interactive mode, accepting commands from stdin, and writing results to stdout.

Operator connection

When --Telnet appears as an argument, the following argument is used as the Operator module's telnet address in <IP>:<port> format. When no --Telnet argument is given, the content of the environment variable "BCI2000TelnetAddress" is used as the Operator module's telnet address. When that environment variable is empty, the default telnet address localhost:3999 is used to connect to the Operator module.

When BCI2000Shell cannot connect to an Operator module at the specified (local or remote) address, it attempts to start up the Operator module locally, launching the Operator executable located in the same directory as the BCI2000Shell executable. In that case, any command line argument to BCI2000Shell or the invoked script will be forwarded to the Operator module as well.

Termination status

BCI2000Shell's termination status is the termination status of the last executed scripting command. As usual, a termination status of 0 indicates "success" or "true".

See also

User Reference:Operator Module Scripting, User Reference:Module Command Line Options