Working with Scripts : Script samples : TCL scripts
 
TCL scripts
TCL is a mature scripting language that extends the functionality of CLI scripting. In FortiManager TCL scripts, the first line of the script is “#!” as it is for standard TCL scripts.
 
Do not include the exit command that normally ends TCL scripts; it will cause the script to not run.
This guide assumes you are familiar with the TCL language and regular expressions, and instead focuses on how to use CLI commands in your TCL scripts. Where you require more information about TCL commands than this guide contains, please refer to resources such as the TCL newsgroup, TCL reference books, and the official TCL web site at http://www.tcl.tk.
TCL scripts can do more than just get and set information. The benefits of TCL come from:
variables to store information,
loops to repeats commands that are slightly different each time
decisions to compare information from the device
The sample scripts in this section will contain procedures that you can combine to use your scripts. The samples will each focus on one of three areas:
TCL variables
TCL loops
TCL decisions
TCL file IO