General TC > Programming & Scripting - Unofficial

Freqmon - a minimalistic approach to monitor CPU frequency

<< < (3/5) > >>

Rich:
Hi guys
I did something similar for displaying time a while back and also struggled with getting rid of the line feed, but I did it.
Maybe there is something of use to you in my script:
http://forum.tinycorelinux.net/index.php/topic,13794.msg77140.html#msg77140

tinypoodle:
Thanks, but I really come to believe there is something particular to watch, which might make the newline unavoidable.

Paulo:
Also keep in mind that the watch that comes with TC is the BusyBox version and not the "normal" version
as found here:  http://procps.cvs.sourceforge.net/viewvc/procps/procps/watch.c?revision=1.16&view=markup

Just had a quick look at the source and straight away I see differences with options available so there could be others too
that forces the extra line.

tinypoodle:
Not impossible.

Rich:
Hi tinypoodle

--- Quote ---I really come to believe there is something particular to watch, which might make the newline unavoidable.
--- End quote ---
I think you may be right. I tried stripping the newline like this:

--- Code: ---watch -t grep M /proc/cpuinfo | tr -d '\n'
--- End code ---
and got no output. If you don't mind replacing  watch  with  sleep 2  then this works:

--- Code: ---aterm -fade 100 -title Freqmon -fg green -bg black -ib 0 -bl +sb -cr black -geometry 4x1+30+30 -e sh -c "while true; do echo -ne '\033[1K\033[1G'; echo -ne `grep MHz /proc/cpuinfo | cut -d: -f2 | cut -d. -f1`; sleep 2; done" &
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version