posts - 13,  comments - 4,  trackbacks - 0
          Linux系統(tǒng)中top命令是交互式命令,故腳本中執(zhí)行時會卡住,不再執(zhí)行下一個命令。
          解決辦法是:top -n 1。
          程序調(diào)用top命令時常會報
          top: failed tty get 錯誤,此時使用top -b。
          -b : Batch mode operation
                      Starts  top  in ’Batch mode’, which could be useful for sending output from top to other programs or to a file.  In this mode, top will not
                      accept input and runs until the iterations limit you’ve set with the ’-n’ command-line option or until killed.
          -n : Number of iterations limit as:  -n number
                      Specifies the maximum number of iterations, or frames, top should produce before ending.
          posted on 2011-12-06 15:39 身在半空 閱讀(2566) 評論(1)  編輯  收藏

          FeedBack:
          # re: linux腳本執(zhí)行top命令
          2014-09-10 10:07 | 繁體字
          嗯,不錯!  回復(fù)  更多評論
            

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           

          <2014年9月>
          31123456
          78910111213
          14151617181920
          21222324252627
          2829301234
          567891011

          常用鏈接

          留言簿

          隨筆檔案

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 剑阁县| 漳州市| 攀枝花市| 阿拉尔市| 济源市| 温州市| 南江县| 砀山县| 都匀市| 姚安县| 华亭县| 乌兰县| 平谷区| 南投市| 桐城市| 白城市| 依兰县| 赞皇县| 沙湾县| 安陆市| 白山市| 宽城| 湘阴县| 如皋市| 祥云县| 卓资县| 通许县| 塔城市| 青田县| 济源市| 岳普湖县| 冷水江市| 大兴区| 达拉特旗| 罗山县| 安康市| 特克斯县| 泰兴市| 双鸭山市| 延寿县| 长治县|