next up previous contents index
Next: Command-Specific Variables Up: Variables Previous: Variables   Contents   Index

Shell Variables

These variables control behavior of the WRspice shell. Most of these variables can be set indirectly from the Shell Options tool from the Shell button in the Tools menu of the Tool Control window.

This read-only variable is set to the number of arguments used to invoke the currently executing script, including the script name. This can be referenced from within scripts only.

This is a read-only list of tokens from the invoking line of the currently executing script, including the script name. This can be referred to within scripts only.

When this boolean variable is set with the set command or the Shell tool (not in a SPICE .options line), variables set in the .options line of the current circuit will be treated the same as variables set with the set command.

With this variable unset, the legacy behavior is maintained, i.e., variables set in .options will work in variable substitution, but will be ignored in most commands.

In releases prior to 2.2.61, when a variable is set in a .options line, it becomes visible almost like it was set with the set command, when the circuit containing the .options line is the current circuit. In the variables listing (set command without arguments or the Variables tool), these have a `+' in the first column. However, they are not part of the normal variable database, and they only ``work'' in special cases. For example, they will work in variable substitution, but won't affect the defaults in most commands, such as the plot command. If the same variable is also set with set, the set definition will have precedence. The variables set with .options can't be unset, except by changing the current circuit.

This was confusing to the user. If a .options line contains an assignment for a plot-specific variable (for example), the variable will appear to be active when listed, but it will have no effect on the plot command.

It can be argued that making the circuit variables behave the same as those set with the set command would be an improvement. In this case, variables listed in the set or Variables tool listing will always have effect, and one can set any variable in the .options line, and have it always ``work''.

On the other hand, circuit variables can't be unset, so a variable in the current circuit would always have effect, desired or not. Also, changing present behavior would possibly adversely affect existing users who expect the current behavior, and this change might break existing scripts.

The cktvars variable gives the user control over how to handle the circuit variables.

This variable sets the number of lines assumed in a page to use when printing output to a file. It will also be used for standard output if for some reason WRspice cannot determine the size of the terminal window (or has no terminal window). If not set, 66 lines will be assumed.

The history variable sets the number of commands saved in the history list. The default is 1000.

If this boolean variable is set, the EOF character (Ctrl-D) is ignored in file input. If not set, an EOF character will terminate the input. When typed as keyboard input, Ctrl-D prints a list of completion matches, if command completion is in use.

If this variable is set, WRspice will skip the exit confirmation prompting it there are simulations in progress or unsaved data when a quit command has been given.

If this boolean variable is set, command completion will be disabled.

If this boolean variable is set, files will not be overwritten with input/output redirection.

By default, command line editing is enabled in interactive mode, which means that WRspice takes control of the low level functions of the terminal window. This can be defeated if noedit is set. If the terminal window doesn't work properly with the editor, it is recommended that ``set noedit'' appear in the .wrspiceinit file. Note that the command completion character is Tab when editing is on, and Esc otherwise.

This variable is ignored under Microsoft Windows. The editing is always enabled in that case.

In interactive mode, error messages are generally printed in a separate pop-up window. When this variable is set, error messages will appear in the console window instead. This variable is automatically set when WRspice is started in JSPICE3 emulation mode (-j command line option given).

If this boolean variable is set, global pattern matching using the characters `*', `?', `[', and `]' is disabled. This variable is set by default, since `*' is often used in algebraic expressions.

If nomoremode is not set, whenever a large amount of text is being printed to the screen (e.g., from the print or asciiplot commands), the output will be stopped every screenful and will continue when a character is typed. The following characters have special meaning:
q Discard the rest of the output
c Print the rest of the output without pausing
? Print a help message
If nomoremode is set, all output will be printed without pauses.

If set, and noglob is unset and a global expression cannot be matched, the global characters will be used literally. If not set, lack of a match produces an error.

If this boolean is set, lists of output are not sorted alphabetically.

This variable contains a string to use as the command prompt. In this string, the `!' character is replaced by the event number, and ``-p'' is replaced by the current directory. If the program is reading lines which form a part of a control block, the prompt becomes a set of `> ' characters, one for each level of control structure. The default prompt is ``$program ! - > ''.

This list variable contains directories to search for command scripts or input files. A list variable in WRspice takes the form of a list of words, surrounded by space-separated parentheses, for example
( /path/to/dir1 /path/to/dir2 "/usr/bill/my files" )
If a directory path contains white space, it should be quoted, as above.

When this boolean is set, WRspice will attempt to execute unrecognized commands as operating system commands.

This variable sets the number of columns assumed in printed output, when output is being directed to a file. This will also be used for standard output if for some reason WRspice cannot determine the width of the terminal window (or has no terminal window). If not set, 80 columns will be assumed.

When WRspice starts in interactive graphical mode from a terminal window, the tool control window will appear above other windows, and the keyboard focus should stay with the terminal window. Similarly, when the user types a command such as a plot command that brings up another window, the new window should appear above existing windows, and the terminal window should retain the keyboard focus.

Unfortunately, not all window managers are cooperative, or know the protocols. By setting this variable, a slightly more brute-force approach is taken to keep the terminal window from losing focus. This may fix the problem, but in some cases this may have side-effects, such as causing pop-up windows to appear below existing windows. Anyway, if the terminal window loses focus when another window pops up, and the user finds this annoying, then setting this boolean variable in the .wrspiceinit file might fix the problem.

Ordinarily, the window manager is asked to raise new windows to the top. If this boolean variable is set, that will not happen. This will probably be needed when using a Windows PC X-server to run WRspice. In Windows, it is not possible to revert the ``window on top'' property, so that if this variable is not set, plot windows and some others will always be shown on top of other windows.

next up previous contents index
Next: Command-Specific Variables Up: Variables Previous: Variables   Contents   Index
Stephen R. Whiteley 2017-02-22