码迷,mamicode.com
首页 > 系统相关 > 详细

shell小技巧速记

时间:2017-06-01 17:47:22      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:文件中   内容   log   ++   div   blog   pre   shell   txt   

1、读取文件中的内容到数组中.

while read buf  
do
  tArray[$c]=$buf
  c=$(expr $c + 1)
done < aa.txt    #文件名是aa.txt

for ((i=0;i<$c;i++))
do
  echo ${tArray[$i]}
done

  

shell小技巧速记

标签:文件中   内容   log   ++   div   blog   pre   shell   txt   

原文地址:http://www.cnblogs.com/yylingyao/p/6929791.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!