Version 3 of ctcl

Updated 2011-02-23 16:34:08 by APN

ctcl is basically a tclkitsh or tclsh replacement for Windows. It is a console application with twapi and sqlite bound in. The biggest difference though from tclsh or tclkitsh is in its accepting scripts from the command line using standard Tcl syntax. Example are below:

Without any arguments, ctcl behaves like tclsh.

If the first argument is a script file, ctcl behaves like tclsh.

Otherwise, ctcl treats the entire line as a Tcl script. No magic, but very convenient under Windows. Examples follow.

tcl::mathop are autoimported

R:\>ctcl + 1 2 3
6

twapi commands are also autoimported.

R:\>ctcl get_process_ids -name notepad.exe
3328 1684

ctcl has its own built-in convenience commands.

R:\>ctcl toclip [read stdin]
This text will go into clipboard
^Z

The command line may have compound commands.

R:\>ctcl xargs end_process [get_process_ids -name notepad.exe]

Command may also be continued across multiple lines.

R:\>ctcl foreach pid [get_process_ids -name notepad.exe] {
> puts "Killing PID $pid"
> end_process $pid
> }
Killing PID 2804
Killing PID 2352