Chinaunix首页 | 论坛 | 博客
  • 博客访问: 354389
  • 博文数量: 79
  • 博客积分: 1270
  • 博客等级: 中尉
  • 技术积分: 1370
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-12 08:48
个人简介

freedom~~~~~~~~~~

文章分类

全部博文(79)

文章存档

2014年(10)

2013年(2)

2012年(13)

2011年(54)

分类: Python/Ruby

2012-05-28 23:31:29


点击(此处)折叠或打开

  1. #!/bin/sh
  2. echo "this is for test function in shell";


  3. a="hello world"
  4. num=2
  5. num2=2
  6. echo "a is "
  7. echo $a
  8. echo "num is ${num}nd"
  9. if [ -f "/etc/first" ]; then
  10.     echo "there is etc"
  11. elif [ -f "./first" ];then
  12.     echo "here has"
  13. elif [ "$num" = "$a" ];then
  14.     echo "num = a"
  15. else [ "${num}"="${num2}" ]
  16.     echo "num = num2"
  17. fi



  18. test()
  19. {
  20.     echo "1 is $1 2 is $2";
  21.     echo "this is in function test";
  22.     return $2;
  23. }

  24. result=$(test 2 222);

  25. echo "end test is $result"

阅读(708) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~