0

I am running following script to monitor some processes and store the output in html file. But on running, it gives the error top: failed tty get. Here is the script:

var=4
while [ $var -ge 0 ]
do
`echo q | htop --p=2164 | aha --black --line-fix >> htop2.html`
#$cmd
sleep 1
var=$(($var-1))
done

Please guide me to solve this error!

0

It seems to me, that you don't have htop installed. What's the output of which htop and alias? Most likely the command htop points to top on your system. Contrary to htop, top cannot be used in non-interactive environments/scripts. Try to install the 'real' htop.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.