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

标签 centos docker expect autoexpect

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

关于centos - docker centos6.6容器上的autoexpect无法工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30917857/

相关文章:

linux - 如何防止并行安装多个版本的 RPM?

mysql - CentOS7 : MariaDB update - Failed to start

docker - gcloud auth configure-docker 失败(config.json 无法读取为 JSON)

apache-spark - Zeppelin无法读取本地文件系统的文件路径

linux - 使用expect后发送命令到远程机器

perl - 不理解我的 crontab 中的简单 perl 脚本

mysql - "mysql 8.0"本地 infile 失败 我尝试并显示设置。会不会是权限问题?

linux - 期望登录后运行 shell 命令

Docker 容器不以 ubuntu 镜像开头(docker start)

linux - 使用 'expect' 自动发送密码