scp不输入密码传文件,使用expect实现&expect离线安装

linux expect安装及expect,tcl安装包 工作中需要对几十台服务器做互信,无意中发现expect命令,研究一番。 expect命令在自动交互中很好用。 压缩包包含安装步骤,安装包,以及 自动互信脚本。 立即下载

linux服务器之间互相传输文件,可以使用scp命令,但是每次传输文件需要输入密码,解决方法可以是两个服务器直接设置公钥证书,也可以使用except脚本实现。

本文记录使用expect脚本实现的方法:

首先需要服务器安装expect,你可以which expect查看服务器上是否有安装。

其次except脚本首行需要注明:

!/usr/bin/expect -f:使用expect来解释该脚本

但是如果是编写bash编辑器的shell脚本,可以通过expect -c的命令嵌入在脚本中,以下是一个scp的脚本示例: 

#!/bin/bash
str1=$1
password="pasword123"
DIR_PATH="/home/wjz"

expect -c "
    spawn scp $1 wls12c@192.168.1.10:$DIR_PATH
    expect {
        \"*password\" {set timeout 300;send \"$password\r\";}
    }
expect eof"

在使用expect时,基本上都是和以下四个命令打交道:

命令作用
spawn启动新的进程
expect从进程接收字符串
send用于向进程发送字符串
interact允许用户交互
  • spawn命令用来启动新的进程,spawn后的expect和send命令都是和使用spawn启动的新进程进行交互。
  • expect通常用来等待一个进程的反馈,我们根据进程的反馈,再使用send命令发送对应的交互命令。
  • send命令接收一个字符串参数,并将该参数发送到进程。
  • interact命令用的其实不是很多,一般情况下使用spawn、expect和send和命令就可以很好的完成我们的任务;但在一些特殊场合下还是需要使用interact命令的,interact命令主要用于退出自动化,进入人工交互。比如我们使用spawn、send和expect命令完成了ftp登陆主机,执行下载文件任务,但是我们希望在文件下载结束以后,仍然可以停留在ftp命令行状态,以便手动的执行后续命令,此时使用interact命令就可以很好的完成这个任务。
  • 如果expect和send同一行需要加{}
  • 如果expect后是{
  • }说明满足这里面任意一个条件就会send

有主机和备机上的应用,现在通过脚本实现以下目的:

1.在主机升级文件后,文件自动同步至备机

2.重启备机

脚本如下:

#!/bin/bash
 
echo 'synchronize scripts begin : '`date +%F_%T`
 

PASSWORD="%r#W@Q!"
DIR=/home/wls12c/weblogic/user_projects/domains/appdomain/app/APP-ROOT
files=`find $DIR -mtime -1`
echo $files
for FILE in $files
do
if [ -d "$FILE" ]; then
echo 'DIR:' $FILE
G_DIR=$FILE
/usr/bin/expect <<EOF
spawn ssh  wjz@192.168.1.10
set timeout 3
expect {
"yes/no" {send "yes\r";exp_continue}
"password" {send "$PASSWORD\r"}
}
expect "*wls12c@*" {send "mkdir -p $FILE\r"}
expect eof
exit
EOF

else
echo 'file' $FILE
DIR_PATH="/home/wjz"

expect -c "
    spawn scp $FILE wjz@192.168.1.10:${FILE%/*}
    expect {
        \"*password\" {set timeout 300;send \"$PASSWORD\r\";}
    }
expect eof"

fi
echo ''
done

echo ''
echo 'synchronize scripts end : '`date +%F_%T`

echo ''
echo 'Start Server at ' `date +%F_%T`

/usr/bin/expect <<EOF
spawn ssh  wjz@192.168.1.10
set timeout 3
expect {
"yes/no" {send "yes\r";exp_continue}
"password" {send "$PASSWORD\r"}
}
expect "*wls12c@*" {send "sh /home/wls12c/weblogic/user_projects/domains/appdomain/start_app_script.sh\r"}
expect eof
exit
EOF
echo 'Back Server has been started! ' `date +%F_%T`

expect离线安装

安装expect依赖tcl

1)下载依赖包

http://www.tcl.tk/software/tcltk/downloadnow84.tml

选择: tcl8.4.20-src.tar.gz

上传至 /usr/local/src目录下

2)安装依赖

tar -zxvf tcl8.4.20-src.tar.gz 
cd /usr/local/src/tcl8.4.20/unix
./configure
make && make install

3)下载安装expect

下载地址:
expect5.45.tar.gz
https://sourceforge.net/projects/expect/files/latest/download

tar -zxvf expect5.45.3.tar.gz 
cd /usr/local/src/expect5.45.3
./configure --prefix=/usr/local/expect --with-tcl=/usr/local/lib  --with-tclinclude=/usr/local/src/tcl8.4.20/generic/
make && make install

建立软连接方便使用

ln -s /usr/local/bin/expect  /usr/local/expect/bin/expect
ln -s /usr/local/bin/expect  /usr/bin/expect

 4)测试: 
(1)输入命令 : expect
(2)如出现:expect1.1>,说明成功。

安装报错:

使用root用户安装expect没问题,但是切换到普通用户使用expect报错:

expect: error while loading shared libraries: libexpect5.45.3.so: cannot open shared object file: No such file or directory

查询libexpect5.45.3.so

find / -name libexpect5.45.3.so

发现是是文件权限问题,修改后即可:

 chmod -R 755 /usr/local/lib/expect5.45.3/

参考文章:

Linux shell 知识心得07 expect+信号处理 - 虾虾78 - 博客园

linux shell用expect实现在scp时自动输入密码_师从名剑山的博客-CSDN博客_expect自动输入密码

expect命令使用 - 简书

Linux技巧(五):expect安装与介绍 | 精美案例 | bash: spawn: command not found详解_血煞长虹的博客-CSDN博客

https://www.cnblogs.com/wangzhigang/p/11753447.html

expect.deb离线包(包含tcl8.5_8.5.11-1ubuntu1和expect_5.45-2) expect.deb离线包,包含 expect_5.45-2_amd64.deb tcl8.5_8.5.11-1ubuntu1_amd64.deb两个 使用命令 dpkg --install expect_5.45-2_amd64.deb dpkg --install tcl8.5_8.5.11-1ubuntu1_amd64.deb 可以直接进行安装,不需要make和./configure这种源码编译操作,谁下谁合适奥! 立即下载

相关推荐

expect安装包

tcl8.4.19-src.tar 和 expect-5.43.0.tar包

Linux安装expect

【代码】Linux安装expect。

Frank_HXF的博客 2889

DySAT+: Enhancing Dynamic Graph Representation Learning with Multi-Head Self-Attention and Temporal-

本文深入探讨了DySAT+模型在动态图表示学习中的创新应用,通过多头时空注意力机制和层级信息融合策略,有效解决了动态图数据中的时间维度信息捕捉和结构演变动态适应问题。该模型在社交网络异常检测和金融交易网络分析等场景中表现出色,显著提升了预测准确率和响应速度。

weixin_29035405的博客 342

Linux系统中,利用expect实现scp文件传输

Linux系统中,利用expect实现scp文件传输

Hello World 1580

MQTT在智能家居中的实战:用Android手机控制ESP8266设备(基于EMQX)

本文详细介绍了如何利用MQTT协议构建一个完整的智能家居控制系统,通过Android手机App远程操控ESP8266设备。文章提供了从EMQX服务器部署、ESP8266端Arduino固件开发到Android客户端搭建的完整实战指南,并深入探讨了系统联调、稳定性优化与安全加固等关键环节,为物联网开发者提供了一套可复用的解决方案。

ujm567890的博客 459

使用DCA1000和EVM板进行数据采集

目录 1. 准备工作 1.1 硬件 1.2 软件 2. 驱动安装 3. 设置静态IP地址 4. 采集数据 5. 采集的数据文件的格式 6. 数据采集存储的数据流 参考资料 1. 准备工作 1.1 硬件 EVM板,电源线(5V,>2.5A),USB线 DCA1000,电源线(5V,>2A),USB线,网线,60pin Samtec cable 1.2 软件 mmWave Studio Matlab Runtime Engine v8.5.1 将DCA1000和EVM板

qq_42235129的博客 1万+

linux神级命令:免交互expect的安装简介与使用

expect与sshpass拥有相同的功能,即在运行ssh,scp等命令时可直接在文本中输入密码,免交互,详情见之前文档sshpass,但expect比sshpass更好的是,expect可以根据搜索的内容填入你想填的内容,不仅仅局限于输入密码,还可以输入yes/no,输入命令等等,可以说expect的功能性是大于sshpass的 下载安装 在线的话可直接 yum install -y expect 离线安装的话需要先下载离线包再安装 # 离线下载安装包 yumdownloader expect.

神芷迦蓝寺 1400

OpenFOAM-v2006重叠网格挖洞问题实战:如何手动修复overset代码中的边缘识别缺陷

本文深入探讨了OpenFOAM-v2006中重叠网格挖洞问题的实战解决方案,重点修复overset代码中的边缘识别缺陷。通过逆向工程解析挖洞决策机制,设计最小侵入式的函数override方案,并建立多级验证体系,有效解决了网格挖洞区域覆盖不全的问题,提升了计算流体动力学模拟的准确性和可靠性。

weixin_29216049的博客 435

scp + expect 实现全自动传送文件

嵌入式工作中总会有各种需求,比如这次,客户希望在板子上实现scp免确认,直接传送文件。那是经过一番折腾,可算是实现了,前因后果,且看下面慢慢道来。 scp 工作模式 ,当用scp 传送文件时,首次总会让确认 $ scp vimrc xxx@192.168.9.250:~ The authenticity of host '192.168.9.250 (192.168.9.250)' can't be established. ECDSA key fingerpr...

qq_20376499的博客 1557

银河麒麟V10 SP1忘记密码?3分钟搞定单用户模式密码重置(附详细截图)

本文详细介绍了银河麒麟V10 SP1操作系统忘记登录密码后的应急恢复方法。核心是通过GRUB引导菜单进入单用户模式,无需密码即可获得root权限,从而快速重置用户密码。文章提供了从捕捉GRUB界面、编辑启动参数到执行密码修改命令的完整步骤图解与常见问题解决方案,帮助用户在几分钟内恢复系统访问。

w3x4y的博客 945

保姆级教程:用Python+OpenCV搞定Orbbec Gemini深度与彩色流对齐(附完整代码)

本文提供了一份详细的Orbbec Gemini深度与彩色流对齐教程,涵盖从环境配置到完整代码实现的每一步。通过解析深度流对齐原理,对比不同对齐模式,并提供工业级应用中的问题排查方法,帮助开发者快速掌握Orbbec Gemini相机的使用技巧。文章还包含进阶应用如点云生成与三维重建的实战代码。

weixin_29090917的博客 472

expect离线安装

expect5.45.4.tar.gz和tcl8.4.11-src.tar.gz压缩包请前往以下链接下载: https://download.csdn.net/download/gangzi221/11933601 安装步骤如下: 1、将expect5.45.4.tar.gz和tcl8.4.11-src.tar.gz这两个压缩包放在/usr/local/src目录下 2、安装tcl: (1)c...

王志刚的博客 3126

MCAL知识点(十):ERU驱动配置详解

ERS:外部请求单元ETL:中断逻辑单元OGU:输出逻辑单元MCU里面配置要使用的功能和选择输入的管脚,注意上述模块关注点讲述的ERU必须和边沿检测模块相关联。

梦想技术家 1227

Linux安装expect命令

1、tcl命令安装 下载tcl安装包:https://sourceforge.net/projects/tcl/files/Tcl/8.6.12/tcl8.6.12-src.tar.gz/download tar -zxf tcl8.6.12-src.tar.gz cd tcl8.6.12/unix/ ./configure --prefix=/usr/tcl --enable-shared make make install # 目录tcl8.6.12/unix/下的tclUnixPort.h复制到g

change_can的博客 4407

基于libVLC的视频播放器之四:直接使用libVLC

一.效果 播放本地文件 播放网络url:rtsp://3.84.6.190/vod/mp4:BigBuckBunny_115k.mov 二.实现 既然有VLC-Qt,为什么还要直接调用libVLC呢,因为直接调用会加深对整个播放流程的理解,方便后面修改VLC-Qt源码。 注意事项: 1.编译报错:error C2065: “libvlc_media_read_cb”: 未声明的标识符。修改如下: 2.libvlc_new(0, nullptr)返回null 将plugins

草上爬的博客 5053

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

离线安装 expect 和 tcl

公司给了测试服务器,很多东西都没有,又没有联网,不能通过yum去下载,只能离线安装,本文是离线安装expect 和 tcl的步骤 1.下载 tcl 和 expect 包 网址:https://download.csdn.net/download/qq_28198181/10708005 2.解压得到两个压缩包 3.上传到服务器并解压(我上传的路径在/var/local/src当中并解压...

GinChou的萌新博客 4305

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

linux下expect安装

expect据说是交互性很强的脚本语言,想安装了玩玩试试,没想到竟然让我纠结两天才安装上,只是因为expect依赖于tcl,但linux系统里一般不自带安装tcl,需要手动安装 expect版本 5.43 http://download.chinaunix.net/download/0003000/2845.shtml tcl版本 8.4.19 http://sourceforge.net...

weixin_30381793的博客 173

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

scp结合expect脚本的一些应用

题目:当前有若干台主机,每台主机上都有一个同名文件夹,文件夹中的路径相同,但是在同名文件夹中 不同主机上可能有不同的文件,现在要把这些文件集中到一台主机上同时保持原有的路径不变。 解决方法:shell脚本+expect脚本实现自动复制,采用scp命令 实现效果: 1、同名文件会重复覆盖 2、不同文件会保存 shell脚本(在汇总主机上执行) #!/bin/bash file_lis...

hyx的博客 621

scp脚本免输入密码(利用expect解释器)

命令来将脚本文件转换为 UNIX 格式,这将删除 Windows 换行符并使其在 Linux 上能够正确解释。主要是做远程创建目录,然后将本地文件或文件夹scp上传(指定服务器传输,免输入密码)如果执行脚本报错,那有可能是脚本编码不是uinx,需转换一下。命令不可用,你也可以使用。

weixin_44928129的博客 656

安装expect

安装expect

weixin_68312438的博客 2026

linux下expect环境安装以及简单脚本测试

expect是交互性很强的脚本语言,可以帮助运维人员实现批量管理成千上百台服务器操作,是一款很实用的批量部署工具! expect依赖于tcl,而linux系统里一般不自带安装tcl,所以需要手动安装 下载:expect-5.43.0.tar和tcl8.4.11-src.tar 下载地址:https://pan.baidu.com/s/1kVyeLt9  提取密码:af9p 将ex

qq2462914396的博客 438

linux 环境安装expect,expect在linux和windows下的安装和使用

一、Linux下expect的安装和使用要使用expect需要预先安装tcl这个东西,然后再安装expect包.我这里使用的是tcl8.4.11-src.tar.gz和expect-5.43.0.tar.gz的安装包.安装tcl和expect#tar zxvf tcl8.4.11-src.tar.gz #cd tcl8.4.11/unix #./configure && make ...

weixin_42300302的博客 600

expect实现scp远程复制文件 spawn LTS

expect实现scp远程复制文件 spawnExpect是一个用来实现自动交互功能的软件套件。使用Expect可以模拟手工交互的过程,实现自动与远端程序的交互。例如当执行ssh命令连接服务器时,需要手动输入密码,如果采用Expect,就可以自动交互,无需再人工手动输入密码了。

abc 1028

CentOS7离线安装Expect

CentOS7离线安装Expect 1.在系统版本相同的能联网的虚拟机里用Yumdownloader【yum -y install yum-utils】下载expect 和tcl的rpm包于服务器上,但是不安装 [root@lw ~]# yumdownloader expect [root@lw ~]# yumdownloader tcl [root@lw ~]# ll 总用量 4136 -rw-r--r-- 1 root ro...

lmzf2011的专栏 3412

linux中提示 /usr/bin/expect: error while loading shared libraries: libexpect5.42.so: cannot open……

linux 执行脚本后提示:/usr/bin/expect: error while loading shared libraries: libexpect5.42.so: cannot open shared object file: No such file or directory

qq_25193147的博客 1368
上一篇: Tomcat 简易升级方法
下一篇: 配置Nginx和其他应用的HTTPS访问
大宇进阶之路
博客等级 码龄12年 1万+粉丝 148原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大宇进阶之路

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值