Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check version

Status
Not open for further replies.

vlz

IS-IT--Management
Aug 11, 2002
56
IL
Hi,
I have Unix box installed with the following Gnu products: Tcl,Tk,Blt,Oratcl,TkTable
How can I found out the version for each product from
command line.

Thanks in advance.

Vadim
Unix sysadmin





 
Do you mean from the Unix (shell) command line? If so, I'm afraid that there isn't a simple --version switch or anything like that. (Tcl and its extensions aren't technically "GNU", and so don't follow the same conventions.)

Once you start a Tcl shell (such as tclsh), you can perform introspection to determine the version numbers. The major.minor version of Tcl is reported by the info tclversion command. Or, you can use the info patchlevel command to get major.minor.patchLevel. Your Tk version is the same as your Tcl version. (You'll know if they aren't in sync; you won't be able to start the wish interpreter. If your Tcl and Tk versions aren't in sync, something really screwy happened with your download and installation, and you should wipe everything and start from scratch.)

To determine the version of a Tcl extension, simply load the extension with the package require command; its return value is the version of the package loaded. (Of course, you need to know the name of the extension to be able to execute the command to load it.)

If you really wanted to be able to query this information from the Unix (shell) command line, you'd need to feed the proper commands into a Tcl interpreter automatically. Here's some examples.

To get the version of Tcl/Tk:

Code:
echo "puts [info tclversion]" | tclsh

To get the version of Blt:

Code:
echo "puts [package require BLT]" | tclsh

To get the version of Oratcl:

Code:
echo "puts [package require Oratcl]" | tclsh

To get the version of TkTable (note that we have to use the wish interpreter, as TkTable requires Tk):

Code:
echo "puts [package require Tktable]; exit" | wish
- Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top