top:failed tty get 错误

运行命令,ps -ef | grep test | grep -v test | awk '{ print $2 }' | xargs top -H -p

想看test的实时状态,结果报了错,查了一下,用脚本在非交互模式下调用top就会出这个错,加上一个 -b,切换到“Batch mode”模式即可解决。

ps -ef | grep test | grep -v test | awk '{ print $2 }' | xargs top -b -H -p

posted @ 2016-05-13 21:29  抟九  阅读(3482)  评论(0编辑  收藏  举报