精品丰满熟女一区二区三区_五月天亚洲欧美综合网_亚洲青青青在线观看_国产一区二区精选

  • <menu id="29e66"></menu>

    <bdo id="29e66"><mark id="29e66"><legend id="29e66"></legend></mark></bdo>

  • <pre id="29e66"><tt id="29e66"><rt id="29e66"></rt></tt></pre>

      <label id="29e66"></label><address id="29e66"><mark id="29e66"><strike id="29e66"></strike></mark></address>
      學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 操作系統(tǒng) > Linux教程 >

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

      時(shí)間: 若木1 分享
      1 cat /etc/shells
      查看計(jì)算機(jī)上可用的shell
      2 編寫(xiě)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
      可見(jiàn)當(dāng)前運(yùn)行結(jié)果。
      4 可以修改firstscript為執(zhí)行
      $chmod a+x firstscript
      此時(shí)輸入$ ./firstscript即可
      上面的shell沒(méi)有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)行,自己測(cè)試。
      23807