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 身在半空 閱讀(2566) 評論(1)  編輯  收藏

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

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


          網站導航:
           

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

          常用鏈接

          留言簿

          隨筆檔案

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 郑州市| 定安县| 伽师县| 金阳县| 革吉县| 达州市| 东宁县| 益阳市| 阜城县| 金溪县| 韶关市| 三台县| 兴义市| 萨嘎县| 汨罗市| 岳西县| 保定市| 隆德县| 南宁市| 陈巴尔虎旗| 桂平市| 普陀区| 聂拉木县| 湖口县| 淳化县| 义乌市| 元阳县| 肥东县| 甘谷县| 通榆县| 镇坪县| 新巴尔虎右旗| 林周县| 澄城县| 密云县| 扎兰屯市| 镇赉县| 巴彦淖尔市| 芜湖县| 建始县| 南靖县|