Quoting Conventions
Tcl separates arguments by whitespace (blanks, tabs, etc.). You can pass space characters by double quoting an argument. The quotes are not part of the argument; they just serve to keep it together. Tcl is similar to the shell in this respect.
set string1 "Hello world"
Double quotes prevent “;” from breaking things up.
set string2 "A semicolon ; is in here"
Keeping an argument together is all that double quotes do. Character sequences such as $, \t, and \b still behave as before.
set name "Sam" set age 17 set word2 "My name is $name; my age is $age;"
After execution of these three commands, word2 is left with the value "My name is Sam; my age is 17;“.
Notice that in the first command Sam was quoted, while in the second command 17 was not quoted, even though neither contained blanks. When arguments do not have blanks, you do not have to quote them but I often do anyway—they are easier to read. However, I do not bother to quote numbers because quoted numbers simply look funny. Anyway, numbers never contain whitespace.
You can actually have whitespace in command names and variable names in which case you need to quote them too. I will show how to do this later, but I recommend you avoid it if possible.
Return Values
All commands return values. For example, the pid command returns the process id of the current process. To evaluate a command and use its return value as an argument or inside an argument, embed the command in brackets. The bracketed command is replaced by its ...