Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1680086
  • 博文数量: 1493
  • 博客积分: 38
  • 博客等级: 民兵
  • 技术积分: 5834
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-19 17:28
文章分类

全部博文(1493)

文章存档

2016年(11)

2015年(38)

2014年(137)

2013年(253)

2012年(1054)

2011年(1)

分类:

2012-05-29 09:05:07

原文地址:简单的shell 作者:any_wind


点击(此处)折叠或打开

  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"

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