LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-27-2005, 04:00 AM   #1
stewchcken
LQ Newbie
 
Registered: Jun 2005
Posts: 18

Rep: Reputation: 0
OUTPUT are ruinned


Dear *,

I wrote a small script as below shown
but output result in file is all ruinned contained strange symbols like

--------------------------------------------------------------------------------------
9;49m^[[m^[(B 99.7% ^[[m^[(B^[[39;49mid,^[[m^[(B^[[39;49m^[[m^[(B 0.0% ^[[m^[(B^[[39;49mwa,^[[m^[(B^[[39;49m^[[m^[(B 0.0% ^[[m^[(B^[[39;49mhi,^[[m^[(B^[[39;49m^[[m^[(B 0.0% ^[[m^[(B

--------------------------------------------------------------------------------------

My script looks like this


#!/bin/bash
COUNTER=0
while [ $COUNTER -lt 10 ];do
date +%c >>/tmp/topresult

sleep 5s

top >> /tmp/topresult

done


Any hints for this problem?
How to I get rid of those strange symbols for outputing result to file?
 
Old 09-27-2005, 04:10 AM   #2
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
Use
top -b
instead (these strange characters you see are control characters that cause the new output to override the old output on the screen).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No output through SPDIf, but analog works. How do I get output through SPDIF? seanwnz Linux - General 11 11-08-2007 11:24 AM
tv output Shibby Linux - Software 1 06-07-2005 11:35 AM
Via AC'97 5.1 Optical Output or Audigy 4.1 Output Nza Fedora 3 06-01-2004 07:49 AM
the sound gives output when using mic but no output when run a music file medo Debian 0 04-19-2004 07:17 PM
Output of ls -l Crashed_Again Linux - Newbie 4 12-11-2003 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration