python使用paramiko执行top命令报错

出错脚本:

ssh.exec_command('top -n 1')

报错信息如下:
TERM environment variable not set

man 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.

不报错脚本:

ssh.exec_command('top -b -i -n 1')

你可能感兴趣的:(python使用paramiko执行top命令报错)