posts - 13,  comments - 4,  trackbacks - 0
          Linux系統中top命令是交互式命令,故腳本中執行時會卡住,不再執行下一個命令。
          解決辦法是:top -n 1。
          程序調用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 身在半空 閱讀(2567) 評論(1)  編輯  收藏

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

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


          網站導航:
           

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

          常用鏈接

          留言簿

          隨筆檔案

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 金堂县| 方正县| 榕江县| 柏乡县| 镇雄县| 华宁县| 石台县| 利川市| 五河县| 清水河县| 浦县| 会同县| 昭苏县| 眉山市| 涿州市| 南开区| 博客| 刚察县| 吉木乃县| 廉江市| 临邑县| 开鲁县| 凉山| 纳雍县| 南安市| 依安县| 习水县| 上饶县| 渭南市| 瑞金市| 米林县| 罗江县| 花莲市| 黄石市| 会东县| 西吉县| 启东市| 建水县| 延长县| 德钦县| 汉源县|