亚洲欧美精品沙发,日韩在线精品视频,亚洲Av每日更新在线观看,亚洲国产另类一区在线5

<pre id="hdphd"></pre>

  • <div id="hdphd"><small id="hdphd"></small></div>
      學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 操作系統(tǒng) > Linux教程 >

      Linux操作系統(tǒng)Shell基礎(chǔ)知識

      時(shí)間: 若木1 分享
      1 cat /etc/shells
      查看計(jì)算機(jī)上可用的shell
      2 編寫shell,保存為firstscript
      #! /bin/bash
      # This is a test.
      echo -n Your current directory is:
      pwd
      echo $HOME
      echo Your current directory is:
      pwd
      #END.
      3 運(yùn)行firstscript
      $ /bin/bash firstscript
      如果找不到文件 使用pwd查看當(dāng)前目錄
      $ /bin/bash pwd/firstscript
      可見當(dāng)前運(yùn)行結(jié)果。
      4 可以修改firstscript為執(zhí)行
      $chmod a+x firstscript
      此時(shí)輸入$ ./firstscript即可
      上面的shell沒有jiao換,我們可以進(jìn)行jiao互,如下:
      #!/bin/sh
      echo -n Please input your ID:
      read id_var
      echo -n Please input your password:
      read password
      echo User ID = $id_var
      echo password = $password
      if [ $password = "admin" ]; then
      echo "password is right"
      else
      echo "password is wrong"
      fi
      同前面的運(yùn)行,自己測試。
      23807