Chinaunix首页 | 论坛 | 博客
  • 博客访问: 45424
  • 博文数量: 9
  • 博客积分: 274
  • 博客等级: 二等列兵
  • 技术积分: 115
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-13 10:39
文章分类
文章存档

2011年(9)

最近访客

分类: Python/Ruby

2011-01-14 00:09:14

这是一个检查RPM文件的程序,结果输出到$1.test里面了。
  1. #!/bin/bash
  2. #rpm-check.sh
  3. #This script is to describe,list and test if a rpm can install
  4. #the fruit save in a file
  5. SUCCESS=0
  6. E_NOARGS=65
  7. if [ -z "$1'" ]
  8. then
  9. echo "Usage:'basename $0' rpm-file"
  10. exit $E_NOARGS
  11. fi
  12. {
  13. echo "Archive Description:"
  14. rpm -qpi $1
  15. echo "Archive Listing:"
  16. rpm -qpl $1
  17. echo
  18. rpm -i --test $1
  19. if [ "$?" -eq $SUCCESS ]
  20. then
  21. echo "$1 can be install"
  22. else
  23. echo "$1 cannot be install"
  24. fi
  25. echo
  26. }>"$1.test"
  27. echo "Results of rpm test in file $1.test"
阅读(2481) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~