I seriously think you've found a feature and you don't know what it is and just want to use it because it's there. Please read this: http://en.wikipedia.org/wiki/Software_flow_control
After you're done, I recommend this in your shell rc: stty -ixon On Thu, Jun 6, 2013 at 12:49 PM, Robert Wohlfarth <rbwohlfa...@gmail.com> wrote: > On Thu, Jun 6, 2013 at 11:29 AM, Nemana, Satya <snem...@sonusnet.com> wrote: >> >> Thanks Travis, Shlomi , Shawn, Luca, and James. >> >> The program pauses i.e does not run further when I press Cntrl –S >> >> When I press Ctrl-Q again, the program resumes excactly where it was when >> I hit cntrl-q. >> >> It is not a deamon, but a simple automation program and it is single >> threaded , goes on sequentially. >> >> I need to try out the programs that you suggested . >> >> However I don’t accept that the program will be running in the background >> when I press Ctrl+s. >> >> In the below example, once I start the program after seeing “i is 5” on >> the output, if I do ctrl+s, the output resumes at I is 6 even if I press >> ctrl+q after a minute or so. >> >> I expect it to print out till say i=65 during the 1 minute and I see the >> output all at once when I do ctrl+q >> >> I tried out a simple shell program and it also seems to be the same.(as >> the perl one) >> >> Is it that if the program is multi threaded or something like that that >> the program will keep to print even though I have paused the screen? > > > Your program doesn't write to the screen. Your program writes to a buffer, > which the operating system then copies onto the screen. Ctrl+S tells the > operating system to stop copying data from the buffer to the screen. It does > not stop your program from writing to the buffer. So your program keeps > running and writes the numbers sequentially into the buffer. > I think "copy" is the wrong way to think about it. I would say directed. But if that explanation works for someone, fine. > If you want to pause the actual program, then try Ctrl+Z. On a unix/linux > box that will work. See > http://www.gnu.org/software/bash/manual/bashref.html#Job-Control for more > information. > I sorta implied this with disown, but I shouldn't have - there's not much need to put jobs in the background anymore - use screen or tmux (it'll save you countless headaches - something locking a file and you end up fuser the file and find the pid is in the background of some terminal, vim complaining there's a swapfile and you end up redoing stuff because you didn't realize it was already open, leaving tail -F hainging out for days, etc). Use these old unix functions if you want, but it's unwise (humm, no - it's just plain idiotic) to do so. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/