我想自动化 passwd
的期望但我没有安装权限。
但是如果我可以复制并粘贴期望的源代码并执行 .c files using
cc/gcc
and generate the executable expect.
或
我可以从Linux复制expect可执行文件并在其他地方使用它,比如solaris、aix等吗?
这是我的 Linux 盒子中/usr/bin/expect 中的期望:
[root@test]# file /usr/bin/expect
/usr/bin/expect: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
最佳答案
适用于 Solaris 和 Linux 的预构建可执行文件位于 kbskit在 *bi“包含电池”版本中包括 Expect(以及许多其他 Tcl 扩展)。每个只是一个大文件,不需要解压或安装,除了例如。 chmod a+x SunOS_kbsvq8.5-bi
使文件可执行。您使用此可执行文件来运行脚本,并且在脚本的开头,您需要添加 package require Expect
来设置 Expect 命令。
关于c - 无论如何,我可以在不安装的情况下使用expect吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14681281/