2

我正在使用 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 ">"

现在我想在 Linux 机器上运行相同的脚本,但是由于我是 Linux 系统的新手,任何人都可以帮助我如何在 linux 系统中安装 tcl 并在那里执行相同的脚本吗?

任何帮助对我来说都很棒。请提供任何有用的链接。

4

4 回答 4

8

你很幸运。RHEL 4 在其存储库中具有期望。你可以简单地安装它yum

yum install expect

它应该安装期望及其所有依赖项。

于 2013-04-17T06:19:32.310 回答
4

You're not using Tcl, you're using expect, which is a separate program which just happens to use 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).

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.

于 2013-04-16T17:19:22.920 回答
3

要在 Linux 上安装 Tcl(我使用的是 RedHat),你可以这样做

yum install tcl

您将获得最新版本的 tcl。

于 2015-09-03T18:09:40.130 回答
2

在 ubuntu 上:

 sudo apt-get install tcl
于 2016-07-29T00:21:51.077 回答