多进程并发执行的shell

33700阅读 0评论2019-01-10 missing-cn
分类:系统运维


点击(此处)折叠或打开

  1. #!/bin/sh
  2. cd /root
  3. thread=17
  4. count=1000
  5. start_line=1
  6. input_file="goluk_2019009.list"
  7. for ((i=1;i<=$thread;i++))
  8. do
  9. begins=`expr $start_line + $i \* $count`
  10. echo $begins >>/root/thread.log
  11. {
  12. for j in `head -$begins $input_file |tail -$count`
  13. do
  14. wcscmd del wcs://goluk/$j >> /root/output.log 2>&1
  15. done
  16. }&
  17. done

上一篇:jenkins从1.651升级到2.151的过程
下一篇:nginx tcp stream 访问日志配置的优化