反正我有可以使用期望无需安装? [英] Is there anyway i can use expect without installing?

查看:200
本文介绍了反正我有可以使用期望无需安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要自动期待 passwd文件,但我不有权安装。
但如果我能复制并粘贴期望源$ C ​​$ c和执行 .C使用文件 CC / gcc的
并生成可执行的期望。

我可以复制期望从Linux可执行文件,只是用它其他地方一样在Solaris,AIX等。

这是期望在/ usr / bin中/期待我的Linux框:

  [根@测试]#文件在/ usr /斌/预期
在/ usr /斌/预计:ELF 64位LSB的可执行文件,AMD的x86-64,版本1(SYSV),为GNU / Linux 2.6.9,动态链接(使用共享库),为GNU / Linux 2.6.9,剥去


解决方案

在prebuilt可执行Solaris和Linux在的 kbskit 包括期望(以及许多其他的Tcl扩展)在*璧列入版本电池。是每一个大文件,无需拆包或安装,除了如。 CHMOD一个+ X SunOS_kbsvq8.5-BI 来使文件可执行。您可以使用这个可执行文件运行脚本,并在脚本的开头你需要添加包需要期待来设置期望的命令。

I want to automate expect for passwd but i dont have permission for installing. but if i could copy and paste the expect source code and execute the .c files usingcc/gcc and generate the executable expect.

or

can i copy the expect executable from linux and just use it anywhere else like on solaris,aix etc.

this is the expect in /usr/bin/expect in my linux box:

[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

解决方案

The prebuilt executables for Solaris and Linux at kbskit include Expect (along with lots of other Tcl extensions) in the *bi "Batteries Included" versions. Each is just one big file, no unpacking or installing is needed, apart from eg. chmod a+x SunOS_kbsvq8.5-bi to make the file executable. You use this executable to run your script, and at the start of the script you need to add package require Expect to set up the Expect commands.

这篇关于反正我有可以使用期望无需安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆