ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
The reason that it doesn't work is that if top is outputting to a terminal (normal operation), it uses the curses library to perform operations such as setting bold/inverse video fonts, moving the cursor etc.
These operations have no meaning when re-directing output to a file, and so curses does not work (complaints about the TERM variable). Using the -b option tells top to print in a way which is OK for re-direction.
Last edited by matthewg42; 10-21-2007 at 04:10 AM.
The reason that it doesn't work is that if top is outputting to a terminal (normal operation), it uses the curses library to perform operations such as setting bold/inverse video fonts, moving the cursor etc.
These operations have no meaning when re-directing output to a file, and so curses does not work (complaints about the TERM variable). Using the -b option tells top to print in a way which is OK for re-direction.
THANK YOU SO MUCH FOR THE COMMAND AND INFO AS WELL, WORKING WELL NOW.
Check the manual page in the Solaris machine and see if there is a similar option for the version of top which installed there. I seem to have some memory from an old sunos4 machine which I worked on that it does, but I do not recall what it is.
Another thought - maybe the Solaris machines do not support option clustering. I also found a manual page on the net which said -n was an alias to -b, so try them separately. Try each of these and see if they help:
Code:
ssh remotehost top -b -n 1 > output
ssh remotehost top -b > output
ssh remotehost top -n > output
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.