shell
小熊@XiaoXiong
这个作者很懒,什么都没留下…
展开
-
Linux shell脚本中用expect实现自动输入密码
1. 安装 expect sudo apt-get install tcl tk expect 2. 使用示例 下面是一个scp的使用例子 #! /usr/bin/expect # 表示使用expect的shell的交互模式 set timeout 100 # 设置超时100秒,如果要执行的shell的命令很长可以设置超时时间长一些,expect超过超时时间没有检测到要找的字符串,则不执行,默认超时时间为10秒 set password "root" # set对password赋值 spawn s原创 2020-12-28 10:48:36 · 714 阅读 · 0 评论 -
shell 进度条
#/bin/bash#进度条 arr=("|" "/" "-" "\\") i=0 var=0 ret="" tmp="" function prob() #在函数中实现进度条 { #while [ $i -le 100 ] #do printf "\r[%-100s[%s%%]][%s]" ${tmp} ${var} ${arr[(($i%4))]} r转载 2017-03-16 18:52:06 · 444 阅读 · 0 评论