Hello i would like to print one script result on the first row... I have a script that display a result per rox and per second..but i would like to print the last result just one time on the first row...and replace it after each second by a new result Ex : for KB/S 12 14 85 46 i would like to replace 12 per 14 and 14 per 85....each result thx for ur help -- This message posted from opensolaris.org
dhizodfhazd wrote:> Hello i would like to print one script result on the first row... > > I have a script that display a result per rox and per second..but i would like to print the last result just one time on the first row...and replace it after each second by a new result > Ex : for KB/S > 12 > 14 > 85 > 46 > > i would like to replace 12 per 14 and 14 per 85....each resultperhaps if you showed us the actual script you''re using, you would save us the guesswork ...? HTH -- Michael Schuster Recursion, n.: see ''Recursion''
Brendan Gregg - Sun Microsystems
2007-May-21 22:40 UTC
[dtrace-discuss] Display script result in one row
G''Day, On Mon, May 21, 2007 at 03:24:38PM -0700, dhizodfhazd wrote:> Hello i would like to print one script result on the first row... > > I have a script that display a result per rox and per second..but i would like to print the last result just one time on the first row...and replace it after each second by a new result > Ex : for KB/S > 12 > 14 > 85 > 46 > > i would like to replace 12 per 14 and 14 per 85....each resultIf you''d like to refresh text on the screen, there are a number of options. 1. Just a return code to redraw a line may solve your issue, eg, # dtrace -x switchrate=10 -qn ''syscall::write:entry { printf("\r%d ", timestamp); }'' 2. In DTrace, call /usr/bin/clear and redraw the entire screen, system("clear"); this does mean you need destructive mode (-w). 3. Like (2), but use printf to print the escape codes from /usr/bin/clear. Either hard code them, or pass them into DTrace from a shell script wrapper. Here you won''t need destructive mode. 4. Use a different interface like the chime GUI, or your own. Having written a bunch of these tools, I''ve found them cute to show to my friends but a pain to use day-to-day. Tools that print a scrolling output usually prove more practical. Brendan -- Brendan [CA, USA]