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 | 繁體字
          嗯,不錯!  回復  更多評論
            

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


          網站導航:
           

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

          常用鏈接

          留言簿

          隨筆檔案

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 普洱| 焦作市| 阿瓦提县| 博兴县| 阿克陶县| 德令哈市| 中江县| 贺兰县| 建阳市| 万荣县| 万年县| 岑巩县| 班玛县| 铁岭县| 丰城市| 醴陵市| 日喀则市| 本溪| 资溪县| 汉沽区| 成安县| 新龙县| 泸定县| 阜南县| 枝江市| 绥芬河市| 云梦县| 富裕县| 迁安市| 尼木县| 茌平县| 乐都县| 榕江县| 石阡县| 锡林郭勒盟| 独山县| 正宁县| 吕梁市| 高要市| 巴南区| 得荣县|