The set command is used primarily to assign values to
variables. It is used like this:
set variable value
If a value is given, set returns that, otherwise set returns the current value of variable.
set foo bar
This returns "bar".
The puts command is mostly used to write to files, but it defaults to stdout so can be used for primitve output.
It is used like this:
puts string file
where file defaults to stdout.
puts foo
outputs:
foo
This commands allows reading from files. It reads one line at a time and chops off the terminating newline.
It is used like this:
gets file ?varName?
If varName is given gets sets
varName to the line just
read and returns the number of characters read, otherwise it
returns the line read. It returns -1 for EOF.
gets
gets stdin variable
expr 4 + 3 * 2
returns 10.
expr knows about functions like abs,
ceil, round etc.
expr sqrt(36)
returns 6.