简体   繁体   English

如何在linux系统中安装tcl

[英]how to install tcl in linux system

I am using a Tcl script to change the poller password through spawning the telnet command. 我正在使用Tcl脚本通过生成telnet命令来更改轮询器密码。 I have done this with the script below, and tested it on a Windows machine after installing ActiveTcl8.5.13.0.296436-win32-ix86-threaded 我用下面的脚本完成了这个,并在安装ActiveTcl8.5.13.0.296436-win32-ix86-threaded之后在Windows机器上测试了它

spawn telnet $serNumber $pNumber
#flush stdout
expect ">"

send "Clients\r"
expect ">"

send "1\r"
expect ">"

send "Pollers\r"
expect ">"

Now I want to run same script in a Linux machine, but as I am new to Linux systems, can anybody help me that how to install tcl in linux system and get executed the same script there? 现在我想在Linux机器上运行相同的脚本,但由于我是Linux系统的新手,有没有人可以帮助我如何在linux系统中安装tcl并在那里执行相同的脚本?

Any help is a great for me. 任何帮助对我来说都很棒。 Please provide any useful links. 请提供任何有用的链接。

You're in luck. 你很幸运。 RHEL 4 has expect in its repositories. RHEL 4在其存储库中有所期待。 You can simply install it with yum : 你可以简单地用yum安装它:

yum install expect

and it should install expect and all its dependencies. 它应该安装expect及其所有依赖项。

You're not using Tcl, you're using expect , which is a separate program which just happens to use Tcl. 你没有使用Tcl,你正在使用expect ,这是一个恰好使用Tcl的独立程序。 To install it, do 要安装它,请执行

apt-get install expect

Note that the above command is a guess as you did not tell us which Linux-based OS you're using ("Linux" is not an OS, it's just a kernel). 请注意,上面的命令是猜测,因为您没有告诉我们您正在使用哪个基于Linux的操作系统(“Linux”不是操作系统,它只是一个内核)。

If you have no one to ask which system you're running, post the results of running the following commands: 如果您没有人询问您正在运行的系统,请发布运行以下命令的结果:

uname -a
lsb_release -a
cat /etc/issue

so we could try to make an educated guess. 所以我们可以尝试做出有根据的猜测。

To install Tcl on Linux (I'm using RedHat), you can do 要在Linux上安装Tcl(我正在使用RedHat),你可以这样做

yum install tcl

And you will get the most recent version of tcl. 并且您将获得最新版本的tcl。

在ubuntu上:

 sudo apt-get install tcl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM