如何在linux系统中安装tcl
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16041821/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to install tcl in linux system
提问by Piyush
I am using a Tcl script to change the poller password through spawning the telnet command.
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
我正在使用 Tcl 脚本通过生成 telnet 命令来更改轮询器密码。我已经使用下面的脚本完成了此操作,并在安装后在 Windows 机器上对其进行了测试ActiveTcl8.5.13.0.296436-win32-ix86-threaded
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.
任何帮助对我来说都是很棒的。请提供任何有用的链接。
回答by kostix
You're not using Tcl, you're using expect
, which is a separate program which just happens to use Tcl. To install it, do
您不是在使用 Tcl,而是在使用expect
,这是一个恰好使用 Tcl 的单独程序。要安装它,请执行
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.
所以我们可以尝试做出有根据的猜测。
回答by slebetman
You're in luck. RHEL 4 has expect in its repositories. You can simply install it with yum
:
你很幸运。RHEL 4 在其存储库中具有期望。您可以简单地安装它yum
:
yum install expect
and it should install expect and all its dependencies.
它应该安装 expect 及其所有依赖项。
回答by stuffatwork190
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。
回答by Albert s
on ubuntu:
在 ubuntu 上:
sudo apt-get install tcl