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

CMD shell updating without newline

Expand Messages
  • doug
    I have a script that runs all day, it checks every 30 seconds to do its task. I have it report the real time each 30 seconds (showing it is running and not
    Message 1 of 5 , Jan 1, 2004
      I have a script that runs all day, it checks every 30 seconds to do its
      task. I have it report the real time each 30 seconds (showing it is running
      and not hung). This fills the cmd window as it runs all day long with the
      date string.

      My question is there a way to update the CMD window display with the current
      time string without adding a new date string and newline?

      example:

      No SGML Files to process at 17:42:33
      No SGML Files to process at 17:43:3
      No SGML Files to process at 17:43:33
      No SGML Files to process at 17:44:3

      what I would like is one line like this that is superseded each time:

      No SGML Files to process at 17:44:3

      Thank you...

      Douglas


      [Non-text portions of this message have been removed]
    • merlyn@stonehenge.com
      ... doug I have a script that runs all day, it checks every 30 seconds to do its doug task. I have it report the real time each 30 seconds (showing it is
      Message 2 of 5 , Jan 1, 2004
        >>>>> "doug" == doug <doug@...> writes:

        doug> I have a script that runs all day, it checks every 30 seconds to do its
        doug> task. I have it report the real time each 30 seconds (showing it is running
        doug> and not hung). This fills the cmd window as it runs all day long with the
        doug> date string.

        doug> My question is there a way to update the CMD window display with the current
        doug> time string without adding a new date string and 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 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@...> <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!
      • doug
        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
        Message 3 of 5 , Jan 1, 2004
          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@... [mailto:merlyn@...]
          > Sent: Thursday, January 01, 2004 6:15 PM
          > To: perl-beginner@yahoogroups.com
          > Subject: Re: [PBML] CMD shell updating without newline
          >
          >
          > >>>>> "doug" == doug <doug@...> 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@...>
          > <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!
          >
          > Unsubscribing info is here:
          > http://help.yahoo.com/help/us/groups/groups-> 32.html
          >
          > Yahoo!
          > Groups Links
          >
          > To visit your group on the
          > web, go to: http://groups.yahoo.com/group/perl-beginner/
          >
          > To unsubscribe from this group, send an email to:
          > perl-beginner-unsubscribe@...6
          >
          > Your use of Yahoo! Groups is subject to:
          > http://docs.yahoo.com/info/terms/
          >
          >
        • 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 4 of 5 , Jan 2, 2004
            --- 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 5 of 5 , Jan 2, 2004
              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.