[SparForte][Banner]
[Top Main Menu] Intro | Tutorials | Reference | Packages | Examples | Contributors   [Back Page]      [Next Page]  

Command Line Options

There are several command options for SparForte.

[SparForte screenshot]
  • --break (or -b) - allow breakout to a shell prompt on a SIGINT or a script error. (e.g. a control-c will give you a shell prompt.) Use "return" to continue execution or "logout" to terminate script. A breakout prompt will allow you to assign values to constants, such as a for loop index, with a warning.
  • --check (or -c) - check the syntax of a script but do not run the script
  • --debug (or -d) -  enable pragma debug's and assert's.  Without this, pragma debug has no effect.
  • --design (or -D) -  specify that this project is in the design phase of the software development life cycle. This will enable/ disable language features and errors suitable to this phase.
  • --exec (or -e) -  the script path is not a path but a script to execute.
  • --gcc-errors (or -g) - show simple gcc-style error messages to be compatible with smart editors and IDEs. Also disables bold and inverse printing in error messages.
  • --help (or -h) - show help on command line options
  • --import-all (or -n) - declare and import all environment variables when SparForte starts
  • -Ld or -L d - specify additional SPAR_LIBRARY_PATH directories (see below)
  • --login (or -l) - simulate a login shell
  • --maintenance (or -m) -  specify that this project is in the maintenance phase of the software development life cycle. That is, that the project has been installed in the production environment. This will enable/ disable language features and errors suitable to this phase.
  • --restricted (or -r) - run as a restricted shell, where a several features are disabled to create a more controlled environment.
  • --test (or -t) -  specify that this project is in the testing phase of the software development life cycle. This will enable/ disable language features and errors suitable to this phase. For example, it will enable pragma assert and pragma test.
  • --trace (or -x) - same as "trace true". Turn on tracing.
  • --verbose (or -v) - show interpreter progress
  • --version (or -V) - show version of SparForte and exit
  • -- - explicitly end of shell options. Use this before specifying files on the command line that contain a leading "-".

Environment Variables Affecting SparForte

When you run the "spar" command, certain variables affect how SparForte runs.

  • PATH - the command search path (always imported)
  • PWD - the present (current) working directory (always imported)
  • OLDPWD - the last PWD (always imported)
  • HOME - the user's home directory (always imported)
  • TERM - the user's terminal emulation (always imported)
  • SHELL - the user's shell (always imported)
  • SPAR_LIBRARY_PATH - the search path for loadable components (always imported)

Restricted Shell Mode

Shells often have a "restricted" mode for running potentially insecure third-party scripts or to give limited shell access to a user.

SparForte also has a restricted shell mode. While it can be used in the same way, the main purpose of SparForte's restricted shell mode is not security. It is used throughout SparForte as a read-only mode, where full shell capabilities are not required. For example, web templates run in restricted shell mode.

System.Restricted_Shell will be true in a restricted shell.

Some of the features disabled in restricted shell mode include:

  • Changing directories with cd
  • Unsetting variables
  • Changing the variables PATH, SHELL, PWD, OLDPWD, HOME or SPAR_LIBRARY_PATH (these are treated as constants)
  • Disabling command redirections that create new files
  • Using databases
[Right Submenu]

 AdaScript versus GCC

 Case Sensitivity

 Reserved Words

 Comments

 Literals

 Bourne Shell Word Expansions

 Fundamental Types

 User-defined Types

 Enumerated Types

 Arrays

 Records

 Basic Assignment

 The @ and % Operands

 Command Argument Shortcuts

 Redirection and Pipelines

 Command Line Interaction

 Built-in Shell Commands

 The Current Directory

 Database Commands

 Flow of Control

 Other Statements/ Subprograms

 External Commands

 Block Statements and Subprograms

 TCP/IP Sockets

 Numeric Formatting with Put

 Interpreter Directives

 Command Line Options

 Command Reference

 ASCII and Latin_1 Character Sets

 Common Error Messages

 Common PHP Functions and the SparForte Equivalent

[Back to Top] Back To Top [Small Forte Symbol]