Prayer

在一般中寻求卓越
posts - 1256, comments - 190, trackbacks - 0, articles - 0
  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

expr数值计算

Posted on 2009-03-05 11:39 Prayer 阅读(227) 评论(0)  编辑 收藏 引用 所属分类: Shell
total='0'

ls -l|grep dr|awk '{printf "%s\n",$9}'>3
while read text
do
   cd  $text
   cd 20070716
   pwd
   wc -l  *|grep total|awk '{print $1}'
   temp=`wc -l  *|grep total|awk '{print $1}'`
   total=`expr $total + $temp`
   cd ..
   cd ..
done<3
echo  $total
   total=`expr $total + $temp` +号前后,必须是空格,否则会作为字符串连接符使用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理