Loading ...
Sorry, an error occurred while loading the content.

Re: [nslu2-linux] Re: Display top process from web page

Expand Messages
  • John
    ... To convert top to a truly valid html (with DOCTYPE, html, head, body, etc.), you would want a modest perl or python script. To just take care of n -
    Message 1 of 5 , Jan 28, 2008
    • 0 Attachment
      On Mon, Jan 28, 2008 at 09:08:31PM -0000, doctordiller wrote:
      > Yes that did the trick. Now I just need to figure out how to produce
      > valid html. How do I substitute the \n with <BR> ? Any ideas ?

      To convert 'top' to a truly valid html (with DOCTYPE, html,
      head, body, etc.), you would want a modest perl or python script.
      To just take care of '\n' -> '<BR>\n' for display on a non-fussy
      browser, the following one-liner is sufficient:

      top -bn1 | perl -pe 's/\n/<BR>\n/'

      You could probably find perl, python, sed, or awk scripts on the
      web that would do a more thorough job.

      --John
    Your message has been successfully submitted and would be delivered to recipients shortly.