13.32.3.1 Built-in Commands

Built-in commands are provided by the Tcl interpreter. They are available in all Tcl applications. Here are some examples of built-in Tcl commands:
  • Tcl provides several commands for manipulating file names, reading and writing file attributes, copying files, deleting files, creating directories, and so on.
  • exec - run an external program. Its return value is the output (on stdout) from the program, for example:

    set tmp [ exec myprog ] puts stdout $tmp

  • You can easily create collections of values (lists) and manipulate them in a variety of ways.
  • You can create arrays - structured values consisting of name-value pairs with arbitrary string values for the names and values.
  • You can manipulate the time and date variables.
  • You can write scripts that can wait for certain events to occur, such as an elapsed time or the availability of input data on a network socket.