docker centos6.6 容器上的 autoexpect 无法工作

autoexpect on docker centos6.6 container cannot work

Docker 容器 纯镜像:centos6.6 在 bash 之后,我安装了这些: yum -y install tar zip unzip expect glibc.i686

软件包 expect-5.44.1.15-5.el6_4.x86_64 已经安装并且是最新版本

和 运行 autoexpect,我总是得到这些错误:

[root@179314389a2c bin]# autoexpect
autoexpect started, file is script.exp
no such variable
    (read trace on "env(SHELL)")
    invoked from within
"spawn -noecho $env(SHELL)"
    invoked from within
"if {[llength $argv]>0} {
        eval spawn -noecho $argv
        cmd "spawn $argv"
} else {
        spawn -noecho $env(SHELL)
        cmd "spawn $env(SHELL)"
}"
    (file "/usr/bin/autoexpect" line 315)

似乎 autoexpect 需要设置 SHELL 环境变量,但您当前的 运行 shell(不是 bash?)没有设置它。所以试试 SHELL=bash autoexpect.