Paxterra Solutions, Inc.

Energy and Operations Efficiency

Training
  Training Course Portfolio  
 

TCL 1 - Basic Expect/TCL Programming


 
 

MODULE 1: Getting Started
What is Tcl
Tcl at the Command Line
Print Function -- stdout
Simple Variables
Declarations
Arithmetic Expressions
Arithmetic Operators
Variable Assignment
Grouping Values
Commenting
Tips & Tricks

MODULE 2: Strings -- What are strings
Introduction to strings
Operating on strings
String commands

  • compare
  • equal
  • first
  • last
  • index
  • range
  • length
  • match
  • is class
  • replace
  • map
  • repeat
  • tolower
  • toupper
  • totitle
  • trimleft
  • trimright
  • trim

String & Expressions
Appending strings
format command
scan command

MODULE 3 -- Lists
Introduction to lists
Operating on lists
Lists commands

  • lindex
  • llength
  • lrange
  • lappend
  • linsert
  • lreplace
  • lsearch
  • lset
  • lsort
  • concat
  • join
  • split
MODULE 4: Control Structure
What's a Tcl control structure?
Conditional Statements
if/else structure
Comparison Operators
switch structure
glob matching
exact matching
regular expression matching
Trapping Errors
Handling Errors
while structure
for structure
foreach structure
Alter loop behaviours
exit command

MODULE 5: Procedures
What's a Tcl procedure?
Declaring procedures
Returning from a procedures
Procedure Arguments

  • single/multiple
  • required/optional
  • variable number

Procedure scope -- not the mouth wash!
Using global and upvar
Argument passing


 

< back

MODULE 6: Arrays
Introduction to arrays
Why and what is an array
array commands

  • set
  • get
  • names
  • unset
  • exists
  • size
MODULE 7: File I/O
Introduction
External programs
exec command
Working with files
  • open
  • close
  • read
  • flush
  • file commands delete
  • dirname
  • tail
  • exists
  • isdirectory
  • isfile
  • type
  • normalize
  • join
  • split
  • mkdir
  • rename
  • size
  • readable
  • writeable
  • executable

glob command

MODULE 8: Scripting
Introduction
Callign the interpreter
Command line arguments
Environmental variables
source command
Accessing libraries
Tcl packages and package command

MODULE 9: Regular Expressions, they're fun!
Regular Expressions
Simple Statements and Modifiers
Pattern Matching
The Metacharacters
Bracing and effects on expressions
regexp command
regsub command
Miscellaneous Tcl commands 

MODULE 10: Error Handling
What is an error?
Handling errors
Processing stack inforamtion

MODULE 11: Expect -- The Basics
Introduction
Spawning a process
Send and receiving data from a user
Send and receiving data from a process
Interacting with expect
Expect looping
Expect key variables
Closing connections
Debugging tips and tricks

 

 
Copyright © 2007-2008, Paxterra Solutions, Inc. All Rights Reserved.