少年阿賓

          那些青春的歲月

            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 閱讀(609) 評論(0)  編輯  收藏 所屬分類: shell
          主站蜘蛛池模板: 上犹县| 韶关市| 广饶县| 辽阳市| 密山市| 涪陵区| 忻城县| 阿坝| 栾川县| 江北区| 罗江县| 桃园县| 南汇区| 黑龙江省| 黄浦区| 灵石县| 凯里市| 舟曲县| 桃源县| 满洲里市| 永吉县| 鹿泉市| 金沙县| 南城县| 左贡县| 莱西市| 旬阳县| 辉南县| 湘阴县| 海原县| 谷城县| 江川县| 陕西省| 阿尔山市| 邵东县| 屏边| 平安县| 屯留县| 肇源县| 阿尔山市| 鹿泉市|