Version 3 of tclsh

Updated 2002-07-23 12:05:59

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.

  • 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
  • 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
  • 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.

Category Application, a part of the Tcl package.