Very basic introduction to script languages

UNIX has an almost uncountable variety of scripting languages available. These vary from the shell which you run in your "xterm" window to the magnificence which is Perl . Most of these scripting languages have something in common, and the more popular ones are based around C type language constructs.

A script file is a list of commands which a shell interpreter reads and executes. The first line in a script file generally has a line which indicates what interpreter to run. The rest of the file is just a sequence of commands, most often just like those you can run on your command line. Script languages include some method for manipulating variables and data.

Seeing as this is a tcl/tk tutorial, we'll use the tcl/tk shells as our example. The tcl/tk package is actually two products: tcl and tk; where tcl is the actual scripting language and tk is an extension for using X widgets (see the tk section). The tcl interpreter is called "tclsh". If your system supports the "which" command you can run:

which tclsh
in order to find out where your tcl interpreter is located. The first line of your tclsh script should be:
#!/your.location/tclsh
where "your.location" is the full path of tclsh on your system. Users at the University of Waterloo on MFCF systems will find the following line works:
#!/.software/local/.admin/bins/bin/tclsh