少年阿宾

那些青春的岁月

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks
1、接收linuxshell控制台输入的字符串参数:
#!/bash/bin
parameter=$1
if [ $parameter = "a" ];then
        echo "equals"
elif [ $parameter = "b" ];then
        echo "not"
else
        echo "kong"
fi
2、接收linuxshell控制台输入的数字参数:
#!/bash/bin
parameter=$1
if [ $parameter = 1 ];then
        echo "input is $parameter"
elif [ $parameter = 2 ];then
        echo "input is $parameter"
else
        echo "input is other: $parameter"
fi


3、接收linuxshell控制台输入的时间参数:











posted on 2015-01-10 19:19 abin 阅读(578) 评论(0)  编辑  收藏 所属分类: shell

只有注册用户登录后才能发表评论。


网站导航: