Loading ...
Sorry, an error occurred while loading the content.
 

Re: [PBML] CMD shell updating without newline

Expand Messages
  • daymobrew@yahoo.com
    ... sequence ... looking to ... see if ... and ... each ... Maybe the code in Term::ProgressBar will help you determine how to update the terminal window
    Message 1 of 5 , Jan 2 3:46 AM
      --- In perl-beginner@yahoogroups.com, "doug" <doug@d...> wrote:
      > Randall:
      >
      > Thanks for the note. Progress bar to my understanding will paint a
      sequence
      > of 50 hash marks, the update() is adding those hash marks. I am
      looking to
      > have one line updated or replaced, not concatenated.
      >
      > Leaving the script the way it is, is fine. I was just looking to
      see if
      > there was some cool way to do this.
      >
      > But thank you...
      >
      > Douglas
      >
      > > -----Original Message-----
      > > From: merlyn@s... [mailto:merlyn@s...]
      > > Sent: Thursday, January 01, 2004 6:15 PM
      > > To: perl-beginner@yahoogroups.com
      > > Subject: Re: [PBML] CMD shell updating without newline
      > >
      > >
      > > >>>>> "doug" == doug <doug@d...> writes:
      > >
      > > doug> I have a script that runs all day, it checks every 30
      > > seconds to
      > > doug> do its task. I have it report the real time each 30 seconds
      > > doug> (showing it is running and not hung). This fills the
      > > cmd window as
      > > doug> it runs all day long with the date string.
      > >
      > > doug> My question is there a way to update the CMD window
      > > display with
      > > doug> the current time string without adding a new date string
      and
      > > doug> newline?
      > >
      > > doug> example:
      > >
      > > doug> No SGML Files to process at 17:42:33
      > > doug> No SGML Files to process at 17:43:3
      > > doug> No SGML Files to process at 17:43:33
      > > doug> No SGML Files to process at 17:44:3
      > >
      > > doug> what I would like is one line like this that is superseded
      each
      > > doug> time:
      > >
      > > doug> No SGML Files to process at 17:44:3
      > >
      > > See Term::ProgessBar in the CPAN.
      > >
      > > --
      > > Randal L. Schwartz - Stonehenge Consulting Services, Inc. -
      > > +1 503 777 0095 <merlyn@s...>
      > > <URL:http://www.stonehenge.com/merlyn/>
      > > Perl/Unix/security consulting, Technical writing, Comedy,
      > > etc. etc. See PerlTraining.Stonehenge.com for onsite and
      > > open-enrollment Perl training!
      > >

      Maybe the code in Term::ProgressBar will help you determine how to
      update the terminal window without using a newline.

      Alternately you can try this:
      #!/usr/bin/perl -w

      $| = 1; # Autoflush after each output.
      print "Hello";
      sleep( 2 );
      print "\r"; # Go to start of line.
      print "there";
      sleep( 2 );
      print "\r";
      # Prints 'Byere' because the 're' of 'there' is not overwritten.
      print "Bye";
    • doug
      Thanks... It worked... Douglas
      Message 2 of 5 , Jan 2 1:56 PM
        Thanks... It worked...

        Douglas

        > -----Original Message-----
        > From: daymobrew@... [mailto:daymobrew@...]
        > Sent: Friday, January 02, 2004 3:46 AM
        > To: perl-beginner@yahoogroups.com
        > Subject: Re: [PBML] CMD shell updating without newline

        > > >
        > Maybe the code in Term::ProgressBar will help you determine how to
        > update the terminal window without using a newline.
        >
        > Alternately you can try this:
        > #!/usr/bin/perl -w
        >
        > $| = 1; # Autoflush after each output.
        > print "Hello";
        > sleep( 2 );
        > print "\r"; # Go to start of line.
        > print "there";
        > sleep( 2 );
        > print "\r";
        > # Prints 'Byere' because the 're' of 'there' is not overwritten.
        > print "Bye";
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.