|
From: Antonio G. <ga...@mc...> - 2009-10-21 07:14:26
|
David Drayton ha scritto:
> Hey guys,
>
> I have to run a command that:
> a) displays progressive output as it runs, and
> b) continues to run, even if the user moves to another page
>
> I have tried the code below, which satisfies (a) but I noticed that when I went to another page, it would stop running and so doesn't satisfy (b) as well. Note that I am only using ping as a test.
>
> open(CMD, "ping 127.0.0.1 2>&1 |");
> while(<CMD>) {
> print $_;
> }
> close(CMD);
>
If you have it in background when the process is killed? :)
One short solution is: you can write the ping output to a FIFO or a temp
file then read it with "tail -f"
Regards, Antonio Gallo
--
(o_ Saluti, Antonio Gallo
//\ http://www.badpenguin.org/
V_/_ IRC: agx
|