- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to remove control characters from the outp...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2002 12:31 AM
12-26-2002 12:31 AM
How to remove control characters from the output of top
I need to find a way to get the output for top into a plain text file which can be sent by email or posted on a web site. I have tried setting the terminal to dumb but top complain about not knowing how to deal with a dumb terminal.
Regards,
John Li Yim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2002 12:37 AM
12-26-2002 12:37 AM
Re: How to remove control characters from the output of top
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2002 12:49 AM
12-26-2002 12:49 AM
Re: How to remove control characters from the output of top
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2002 01:42 AM
12-26-2002 01:42 AM
Re: How to remove control characters from the output of top
Another way is ussing tr command (translate caracters) to clear not wanted chars, pls see man, is too easy.
sed command may be is usefull to you, i.e:
cat file_in | sed 's/^M//' > file_out
In this case ^M will be replaced by null, in others words, deleted.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2002 02:07 AM
12-26-2002 02:07 AM
Re: How to remove control characters from the output of top
From a windows 98 PC i will telnet and login to unix server and run
#top
Then In the windows telnet window select Edit -> Select all
then Edit -> copy all
I will then paste it to a word file which you can mail. It works without problem.
regards,
U.SivaKumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2002 03:04 AM
12-26-2002 03:04 AM
Re: How to remove control characters from the output of top
I once tried to make a crontab script execute a top command and afterwards mail the result; tricky because of the many control chars produced by top. The attached script shows my last attempt - which looks unfinished (which it is) but I have just checked that it actually worked on a 11.0 machine where it mailed a nice output to me.
The idea of the script is first to redirect std. error from top to /dev/null, as many of the noisy chars are written to that. Afterwards the control char sequences are replaced by spaces, one by one. Not at very elegant solution, but that might be the way to go.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2002 04:07 AM
12-26-2002 04:07 AM
Re: How to remove control characters from the output of top
top -s1 -d1 -f fname.top
iconv -f roma8 -t iso81 fname.top >top.txt
or you could user the command ux2dos.
hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2002 04:57 AM
12-26-2002 04:57 AM
Re: How to remove control characters from the output of top
top -d1 -f works form me and I just redirtect it into a file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2002 04:58 AM
12-26-2002 04:58 AM
Re: How to remove control characters from the output of top
top -d1 -f works for me and I just redirect it into a file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2002 05:29 AM
12-27-2002 05:29 AM
Re: How to remove control characters from the output of top
Yes you can get it into a file, and even cat the file and it looks okay. But try to do a more on it, or better yet, try to vi it. You'll see that the formatting is all hosed up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2002 05:10 AM
12-30-2002 05:10 AM
Re: How to remove control characters from the output of top
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2002 05:19 AM
12-30-2002 05:19 AM
Re: How to remove control characters from the output of top
On my systems, both 10.20 and 11.0, the "top -d 1 -n 1000 -f filename" output looks fine, both with vi(1) and more(1). Doing a vis(1) on the output file gives an indentical output, i.e. there are no control characters (other than the normal end-of-line linefeed) in the output file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2002 07:24 PM
12-30-2002 07:24 PM
Re: How to remove control characters from the output of top
I have tried it for the past few days and the output is fine now.
Regards,
John Li Yim