Gracefully stopping an infinite loop after a particular keyboard input



I am having a script that is doing some tests continuously. I am
running it from cygwin under Windows OS and is currently using CTRL+C
to stop the script. But by "ctrl+c" the script stops at that very
moment. In between there are some read write operations going on files
and when the script stops atonce.

I want that when I press any key say "Q" from keyboard , the script
should complete that particular loop and then stop. (Hope I am able to
clarify my problem).

.



Relevant Pages

  • Re: [SLE] Windows backups to a Linux server
    ... will just rsync the system to the linux server. ... .BAT file that called cygwin and my bash script. ... Windows event scheduler and all was fine. ...
    (SuSE)
  • Re: hpw to convert a linux python script ?
    ... Find the directory in which your script lives. ... When you want to open a data file in the script's directory, ... sys.exit("Only configured for Windows and Cygwin") ...
    (comp.lang.python)
  • Re: Download email attachement automatically with no client
    ... I'm also limited for the Windows ... However, since Windows lacks a mature scripting environment, something like ... Cygwin should have an ancient, but a somewhat usable Perl build. ... It should be possible to cobble together a Perl script that performs the necessary work. ...
    (comp.mail.misc)
  • Running a Perl script under Cygwin
    ... Does anyone know how to call that script from ... outside the Cygwin prompt? ... For instance, from the WIndows scheduler? ... We have at work a bunch of Unix boxes and we use Control-M to ...
    (comp.os.linux.misc)
  • Re: cygwin make does not execute command under XP
    ... > I have a small problem running a make script under cygwin on a PC with ... > windows XP. ...
    (comp.lang.c)