亚洲欧洲国产欧美一区精品,激情五月亚洲色五月,最新精品国偷自产在线婷婷,欧美婷婷丁香五月天社区

      考試首頁 | 考試用書 | 培訓(xùn)課程 | 模擬考場 | 考試論壇  
        當(dāng)前位置:Linux認(rèn)證 > 綜合輔導(dǎo) > 文章內(nèi)容
        

      linux從入門到精通(39)

       [ 2016年6月27日 ] 【

      while循環(huán)語句——重復(fù)測試指定的條件,只要條件成立則反復(fù)執(zhí)行對應(yīng)的命令操作

        while語句的結(jié)構(gòu)

       while  命令或表達(dá)式 

       do 

            命令列表

       done

        while語句簡單應(yīng)用示例

      批量添加20個系統(tǒng)用戶帳號, 用戶名依次為“stu1”、“stu2”、……、“stu20”
      #!/bin/bash
      i=1
      while  [  $i  -le  20  ]
      do
          useradd stu$i
          echo "123456" | passwd --stdin stu$i &> /dev/null
          i=`expr $i + 1`
      done 

       

       

      批量刪除上述添加的20個系統(tǒng)用戶帳號
      #!/bin/bash
      i=1
      while  [  $i  -le  20  ]
      do
          userdel -r stu$i
          i=`expr $i + 1`
      done 
      將考試網(wǎng)添加到收藏夾 | 每次上網(wǎng)自動訪問考試網(wǎng) | 復(fù)制本頁地址,傳給QQ/MSN上的好友 | 申請鏈接 | 意見留言 TOP
      關(guān)于本站  網(wǎng)站聲明  廣告服務(wù)  聯(lián)系方式  站內(nèi)導(dǎo)航  考試論壇
      Copyright © 2007-2013 中華考試網(wǎng)(Examw.com) All Rights Reserved