Search This Blog

Friday, 20 September 2024

Introduction to Tool Command Language (TCL)

0 comments

Tool Command Language (TCL)

  • TCL was first introduced by John Ousterhout in 1989, and became popular in 1993
  • TCL was originally developed in the UNIX environment and then ported to most platforms such as Windows and Macintosh
  • TCL is a simple language for issuing commands to a variety of interactive tools
  • TCL allows its users to define procedures for implementing more powerful commands than that of the commands available in the tools base set

  • TCL is a scripting language with the help of which scripts can be written to tie together piece of code written in other programming languages like C
  • TCL makes use of the features of two different high level languages:
    • Conventional programming languages such as C or C++ for creating components containing complex internal data structure for storage and processing of data
    • Scripting language to 'glue' those components of high level languages together
  • TCL Shell is a command-line interpreter that makes use of an interpreter for entering and running TCL commands
  •  TCL can be used for a wide range of applications.  For instance:
    • The National Broadcasting Company (NBC) uses TCL for its master control for distribution of programming
    • CISCO uses TCL for its Automated Test System, which checks router configuration

Structure of TCL Commands:

  • TCL commands have the similar structure as that of the commands given in UNIX or DOS OS
  • Each command consists of one or more words separated by white space.  The first word is a verb (command word) and the remaining words (if any ) are arguments

  • The command word may belong to any one of the following set of commands:
    • Built-in commands of TCL
    • User written procedure in TCL
    • User supplied external function written in C 

  • TCL alone can be used for developing applications.  In this scenario, it uses simple shell (tclsh) for reading lines of input from the keyboard and passes them to parser for processing
  • TCL is considered as an embedded interpreter which provides a command-line interface for its host application 
  • TCL Pro is a product that includes a wrapper for creating a single executable file containing everything needed to run a TCL application

Symbols used in TCL Commands:

  • $ sign used in a TCL command indicate the substitution of the value of a variable
  • \ (back slash) is used to introduce special character
  • { } encloses a string
  • [ ] encloses script to be evaluated immediately
  • # indicates a command line when used as a first character of a TCL command

    Braces {} and double quotes " " can be used to group elements into sub-lists.  As with commands, braces provide strict quoting, while double  allow substitutions using $

    For instance, consider the following TCL comands:


 

Leave a Reply