The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
CDE running but not display on screen silves AIX 0 01-17-2008 07:49 AM
screen display help zilla30066 Shell Programming and Scripting 2 01-30-2007 07:49 PM
simple perl script not working hankooknara Shell Programming and Scripting 4 01-11-2007 02:02 AM
file display on screen on pg at time zip_zip Shell Programming and Scripting 1 09-07-2003 04:30 AM
controlling screen display jrdnoland1 Shell Programming and Scripting 6 02-08-2002 05:09 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-19-2002
Shakey21
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
Simple Perl Script to Screen Display


$number_clients++;

print("Creating client $number_clients\r");


I have been using the above to increment on the screen as the script increments throughout a while loop. What I would like to know is what is the trick to keep the last one on the screen without printing it again?

Ie

...Script running

Creating client 500

End of script

At the moment it runs through and just removes the last one from the screen....

Thanks in anticipation, I am sure it is a simple answer...
  #2 (permalink)  
Old 04-19-2002
auswipe's Avatar
auswipe auswipe is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Wide Awake Wylie, Texas
Posts: 535
I haven't seem a simple way around the problem (although, it is interesting to note that under Win32 with ActiveState the \r is not a problem although it is under Unix).

How about something like this?

Code:
#!/usr/bin/perl

my $counter = 0;

while ($counter++ <= 1000) {
  print "Counter is $counter";

  # Doing lots of work that takes a while

  print "\r"
};
print "\nDone!\n";
When the creating takes a while the message is still displayed on the line and the carriage return doesn't take place until the work is done and ready for the next iteration.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:40 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0