I'm looking for a very straight-forward way of getting the version of the TCL installed on a machine from the command-line. For most programming languages, something along the lines of
languagename -v
provides the information that I want. This does not seem to be an option for tclsh
.
The TCL FAQ Q.B21 suggests
echo 'puts $tcl_version;exit 0' | tclsh
but I wonder if there is anything more straight-forward and cross-platform? (I suspect that this would fail mightily on a Microsoft Operating System.)
--
EDIT: Just to emphasize that I'm looking for something that can be executed directly from the operating system command-line. There's all kinds of information available once you start tclsh
, but I'm trying to avoid that to ease automated discovery.
puts [info patchlevel]
instead ofputs $tcl_version
. Also, you don't explicitly need toexit
-- Tcl will see the end of the script and exit on it's own. – Zohartclsh
doesn't play like the others do. – Studdingtclsh
CLI API is horrendous! – Garek