Version 8 of tclsh

Updated 2002-07-23 13:00:08

This is an application created by default by the core distribution. It is a simple shell interpreter, and is frequently used by developers writing tcl scripts.

A user of tclsh (or of wish, the interactive tcl shell with Tk automatically loaded), should be aware that there are a few differences between typing tcl statements to the shell in interactive mode and typing tcl commands into a file and then executing it.

  1. tcl_interactive
interactive
this variable is set
command file
this variable is set to 0
  1. unknown proc differences - if tclsh is unable to recognize the command typed, the unknown proc is invoked.
interactive
unknown will automatically pass command to exec .
command file
the coder must specify exec before any non-tcl commands
  1. abbreviations
interactive
the unknown command looks to see if the typed command is an abbreviation of an existing command and, if it is, invokes it. Thus in interactive mode it's possible to write
    set fp [op $myfile]
command file
would require open be written out in full.
  1. standard output displayed
interactive
stdout appears to the screen when you type commands
command file
the coder must specify puts to get the output from a command to display to the screen
  1. byte-compilation
interactive
prompt commands are byte compiled
command file
top level commands are not byte compiled

Category Application, a part of the Tcl package.