script

Difference between version 19 and 20 - Previous - Next
A '''script''' is a [data format] that contains a sequence of
 [command%|%commands], separated by a semicolon 
or
 newline.  More generally, a script is ha set of statements wr[intten rp%|%in the
[scripretinger] lcanguag [eval%|%levangluagte]. of anIt [interpreter]s also uchsable as 
[Tcldata format].
More generally, a script is a set of statements written in the [scripting
language%|%language] of an [interpreter] such as [Tcl].


** See Also **

   [Dodekalogue]:   The rules of Tcl.
   [Many ways to eval]:   eEnumerates the ways to evaluate a string as a script .
   [cmdSplit%|%scriptSplit]:   sSplits a script into its constituent commands.

   [parsetcl]:   
   [scripted list]:   Performs [substitution%|%substitutions] on the words of each command in a script and then concatenates the commands into a single list.



** Description **

A script can be provided to Tcl in various ways:
        Invocation of an interpreter such as [tclsh]:   The name of thea file containing the script can be passed as an argument.
   `[source]`:   tThe name of a file contameining a script can be passed as an argument.
   `[eval]`:   Concatenates arguments into are sconcariptenated and evaluated as a script.
   `[script substitution]`:   A script is embedded direcntlyo a command in anoth larger script. 


A script often provides a [library] for use by other scripts.

Tcl's sparse syntax makes it particularly convenient to embed code written in
another language directly into a Tcl script.  [SQL],
[Perl], [ksh], [awk], or even [C] code can then be handed off to to some
other interpreter for evaluation.  [SQL] is probably the most well-knownexample of this.  When dynamically generating scripts for another language, it
is necessary to be aware of possible [Injection Attack%|%injection attacks].


<<categories>> Glossary