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)航:
           

          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿

          隨筆檔案

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 永宁县| 那坡县| 东山县| 余庆县| 阳山县| 邳州市| 株洲市| 黔南| 鹤壁市| 嵩明县| 门源| 北宁市| 类乌齐县| 大同县| 油尖旺区| 阜新市| 海城市| 巢湖市| 诸城市| 吉林省| 土默特右旗| 长岭县| 晋中市| 晴隆县| 镇平县| 梅河口市| 承德市| 凤山县| 赞皇县| 阳新县| 保定市| 海南省| 中超| 鹤壁市| 宜君县| 股票| 文登市| 开远市| 阳城县| 逊克县| 北安市|