TCL

 What is Tcl ?

A widely used scripting tool that was developed for controlling and extending applications


Use the skills you  learn  today  one  month from now with minimal burden.

The  terms we use regularly from here on is  

Lists ,  Strings , Procedures , Control flow , Math functions , Pattern matching and counting


TCL in Synopsys tool

Variables

scalars

set,unset

variable substutions $

example:  set a 5 | set a "Hello" |

                    info exists   a >> true  

                    info vars  a*   >>returns all variables with a

Predefined commands

Env  - Array names env

        -echo $env(HOME)

        -Predefined command  - getenv HOME

Scripts     :   The file consisting the combined commands and tcl commands to run at a time is script file.

source

Redirect ->

        # used for commenting line 

        /  used as the continuation for command in next line

Data Types  : 

String   :- is a sequence of characters ie, "hello "

Array    :- 

List       :- ordered group of elements  [a b c d e f  ]  , lindex[0],lindex[end]


?

set a "this is the beginning"

regsub {is } $a  "was" b  

echo $b ---->thwas is the begining"

regsub -all {is} $a "was" b

echo $b ---->thwas was the begining"

set b [string map {is was} $a]

 echo $b ---->thwas was the begining"



Comments