Get the version of TCL from the command-line?

This might sound too simplistic, but if you made a script file that contained the commands:

puts $tcl_version

And then ran tclsh sillyscript.tcl, that would execute on all platforms, assuming binary is in PATH. It certainly isn’t fancy or flashy, or even neat, but it satisfies that requirement AFAIK.

====

I got curious, so I tried it and without the quotes:

echo puts $tcl_version;exit 0 | tclsh

Executes just fine on my windows box… maybe platform detection prior to the TCL detection is an option?

Leave a Comment