Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

determine Tcl version

1,393 views
Skip to first unread message

Patrick H.

unread,
May 12, 2010, 6:55:19 PM5/12/10
to
Hi, I am running Ubuntu and just installed Tcl using the command "apt-
get install tcl". Tcl is installed and working, but I was wondering
how I can determine what version I have installed? Thanks,

Patrick

Bruce Stephens

unread,
May 12, 2010, 7:01:59 PM5/12/10
to
"Patrick H." <patr...@gmail.com> writes:

You can ask the package manager, with "dpkg -p tcl". Tcl sets variables
like tcl_version and tcl_patchLevel, so you can do

echo 'puts $tcl_patchLevel' | tclsh

Patrick H.

unread,
May 12, 2010, 7:04:54 PM5/12/10
to
On May 12, 6:01 pm, Bruce Stephens <bruce+use...@cenderis.demon.co.uk>
wrote:

That worked as you described - thanks for the quick reply, I
appreciate it.

Patrick

Donal K. Fellows

unread,
May 13, 2010, 3:44:08 AM5/13/10
to
On 13 May, 00:01, Bruce Stephens <bruce+use...@cenderis.demon.co.uk>
wrote:

> You can ask the package manager, with "dpkg -p tcl".  Tcl sets variables
> like tcl_version and tcl_patchLevel, so you can do
>
>         echo 'puts $tcl_patchLevel' | tclsh

It's also the result from [package require Tcl] so this would also
work:

echo 'puts [package require Tcl];exit' | tclsh

That will work for any other package on Tcl's default package path
too. Just use the correct package name instead of “Tcl” above. :-)

Donal.

Donald Arseneau

unread,
May 14, 2010, 4:41:35 AM5/14/10
to
On May 13, 12:44 am, "Donal K. Fellows"

<donal.k.fell...@manchester.ac.uk> wrote:
> On 13 May, 00:01, Bruce Stephens <bruce+use...@cenderis.demon.co.uk>
> wrote:
> >         echo 'puts $tcl_patchLevel' | tclsh

>   echo 'puts [package require Tcl];exit' | tclsh

Why hasn't anyone suggested
info patchlevel
?

Donald Arseneau

Donald G Porter

unread,
May 14, 2010, 7:47:05 AM5/14/10
to

Concern about those forced to stay on version 7.4 ?

:D

DGP

phil

unread,
May 21, 2010, 10:04:54 AM5/21/10
to
>   echo 'puts [package require Tcl];exit' | tclsh


You know, that's always bugged me! Exaplaining that to admins...
and then its really hard to automate that check...

How hard would it be to add --version or -V ?

% tclsh --version
8.5.8

Uwe Klein

unread,
May 21, 2010, 11:17:24 AM5/21/10
to
phil wrote:
>> echo 'puts [package require Tcl];exit' | tclsh
>
>
>
> You know, that's always bugged me! Exaplaining that to admins...
> and then its really hard to automate that check...

What is hard about it?

TCLVER=$(echo 'puts [package require Tcl];exit' | tclsh)

>
> How hard would it be to add --version or -V ?
>
> % tclsh --version
> 8.5.8
>

uwe

0 new messages