yt-summer 发表于 2018-8-30 06:54:27

Linux下模拟多线程的并发并发shell脚本

#!/bin/bash  
ip=`cat iplist.txt|grep -v "#"|awk '{print $1}'`
  
dir='/usr/local/src'
  
answer="yes"   #定义yes/no应答变量
  
passwd="123456"#服务器密码
  
thead_num=50
  
tmp_fifo_file="/tmp/$$.fifo"
  
mkfifo $tmp_fifo_file
  
exec 4$tmp_fifo_file
  
rm -f $tmp_fifo_file
  
for ((i=0;i&4
  
for i in $ip
  
do
  
         read -u4
  
               {
  
                         expect &-
  
exit 0


页: [1]
查看完整版本: Linux下模拟多线程的并发并发shell脚本