Let me start with a security warning. Passwords and firewalls are there to make it difficult for unauthorized users to get through / at systems, and if you write a script which automates passwords and multi-hop telnet and ssh logins to make it quick and easy for you to get over all the hurdles you ....
If you're typing the same series of instructions into your computer time and time again, perhaps with predictable variations depending on the responses that you get, you should consider using Expect. Expect adds three extra major commands to the Tcl language:
• spawn to start a process
• ....
I've got a certain inquisitiveness about Industrial Archeology, an interest in transport with something of a current specialization in rail - so it's no surprise that I'll spot odd railway-like structures dotted around the countryside and wonder "what is/ was that?". The old water tower at Druid's L ....
Split and join in most languages convert strings of text into arrays / lists / collections of other sorts. But in Tcl, all variables are held as strings, so are split and join actually needed?
If you're working with a collection of single words - no embedded spaces, no special characters, space de ....
There are so many times you want to say "if ... then ... else" to do no more than choose between the word "is" and "are", to say "child" or "children", or to say "may" or "may not" in your output. Using an if statement for that's a lot of code for a little job.
In most of the languages we teach ( ....
Windows 7 went on sale at midnight ... and at ten past, I got my first bulk sales email with a subject line Windows 7 out now - time for a new PC. Slight pity that the graphic on the top of the email still says "PC World Recommends Windows Vista Home Premium" ;-).
But - in all seriousness - how wil ....
The other day, I used the term "beyond the pale" in conversation with some delegates, and as an afterthought commented - "I don't know where that saying comes from / originates". Well - they knew one origin at least!
It comes from Ireland ... the English aristocracy settled centuries gone by in t ....
In Tcl, all variables (except 'arrays') are held as strings of text - and that includes lists. A list is a string which is treated as a collection of individual words, space separated, and you can then select individual words by their word number.
And this means that if you have a simple, space se ....
There are times when a Tcl command can fail because of the data being passed in to it ... and when it fails, it can do so with a spectacular crash! For example, the glob command which matches files to a pattern (Tcl's ls or dir if you like to think of it that way) can go 'belly up' if there are no ....
When you want to pass data INTO a proc in Tcl from a regular variable, you write the variable name with a $ in front of it in the code and the value is substituted. But this doesn't work if (a) you are passing an array (which cannot be expanded into a string or (b) you want to change the value in a ....