Predefined Variables

Table 2-2. Variables defined by tclsh and wish.
argcThe number of command-line arguments.
argvA list of the command-line arguments.
argv0The name of the script being executed. If being used interactively, argv0 is the name of the shell program.
embed_argsThe list of arguments in the <EMBED> tag. Tcl applets only. See page 298.
envAn array of the environment variables. See page 117.
tcl_interactiveTrue (one) if the tclsh is prompting for commands.
tcl_libraryThe script library directory.
tcl_patchLevelModified version number, e.g., 8.0b1.
tcl_platformArray containing operating system information. See page 182.
tcl_prompt1If defined, this is a command that outputs the prompt.
tcl_prompt2If defined, this is a command that outputs the prompt ...

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.