zoukankan      html  css  js  c++  java
  • 同步文件,不需要密码

    expect是建立在tcl基础上的一个工具,它用来让一些需要交互的任务自动化地完成。


    因为expect是基于tcl的,所以需要你的系统中安装有tcl
    如何检查?
    [root@dev ~]# whereis tcl
    tcl: /usr/lib/tcl8.4 /usr/share/tcl8.4
    如果看不到结果,请先安装tcl

    安装


    > 安装tcl
    解压tcl安装包后
    cd tcl8.4.11/unix/
    ./configure --prefix=/usr/local/tcl/ --enable-shared
    make && make install


    > 安装expect
    解压expect安装包后
    cd expect-5.43
    ./configure --prefix=/usr/local/expect/ --with-tcl=/usr/local/tcl/lib/ --with-tclinclude=/opt/tcl8.4.11/generic/ --enable-shared
    make && make install
    注意:指定的/opt/tcl8.4.11/generic/ 为我们上面解压的tcl目录


    > 创建连接符号
    ln -s /usr/local/expect/bin/expect /usr/bin/expect
    > 查看连接符号
    ls -l /usr/bin/expect
    lrwxrwxrwx. 1 root root 28 9月   8 11:21 /usr/bin/expect -> /usr/local/expect/bin/expect
    这个符号链接将在编写expect脚本文件时用到,例如在expect文件头部会指定用于执行该脚本的shell 
    #!/usr/bin/expect 


    > 测试
    [root@localhost opt]# expect
    expect1.1> exit
    [root@localhost opt]# 

    这样就可以开始运行expect脚本了。

    --------------------- 本文来自 catoop 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/catoop/article/details/48289991?utm_source=copy 

  • 相关阅读:
    使用header发送状态代码
    apache rewrite模块基础知识
    Deprecated: Function set_magic_quotes_runtime() is deprecated
    Xmind3.3强烈推荐
    windows 下安装svn服务
    Zend Studio 8
    mysql触发器
    程序员每天该做的事(转载)
    你真的了解.NET中的String吗?
    VS2005中Build顺序的设定
  • 原文地址:https://www.cnblogs.com/xkcp008/p/9718164.html
Copyright © 2011-2022 走看看