Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3401174
  • 博文数量: 534
  • 博客积分: 11595
  • 博客等级: 上将
  • 技术积分: 5785
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-22 17:00
文章分类

全部博文(534)

文章存档

2015年(4)

2014年(27)

2013年(15)

2012年(38)

2011年(36)

2010年(85)

2009年(63)

2008年(142)

2007年(124)

分类: LINUX

2010-10-28 10:12:52

脚本内容:
[neo@gateway yuebao]$ cat t1.sh
#!/bin/awk -f
{
  sum+=$0;
}
END {
  printf("%s used value:\n%f\n",FILENAME,100-sum/NR);
}
 
 
文本内容:
[neo@gateway yuebao]$ cat 4A-cpu-yuebao-10.txt
97.02
87.41
99.81
98.2
98.94
90.03
99.93
96.89
99.79
99.91
99.7
74.97
 
 
执行结果:
[neo@gateway yuebao]$ ./t1.sh 4A-cpu-yuebao-10.txt
4A-cpu-yuebao-10.txt used value:
4.783333
阅读(1249) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-10-28 18:17:09

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com