in reply to Re^12: show a message only during the sleep time
in thread show a message only during the sleep time

No. You're confusing backquotes with system again.

If you want to launch the program as a child process:

system "/usr/local/www/cgi-bin/ntop/ntop.sh", "stop" and die "... ";
If you want to capture the output of the ntop command:
my $output = `/usr/local ...`;
Don't take the output of ntop, and feed it back to system!

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^14: show a message only during the sleep time
by cc (Beadle) on Jul 25, 2005 at 22:09 UTC
    thanks,
    I changed to:
    my $stop = `/usr/local/bin/sudo /usr/local/www/cgi-bin/ntop/ntop.sh st +op` or die "cannot stop ntop: $!";
        or has someone any other idea ?
        this script should stop the ntop and start it again after 8 seconds.

        I did some tests and ntop will be stopped with:
        my $stop = `/usr/local/bin/sudo /usr/local/www/cgi-bin/ntop/ntop.sh st +op` or die "cannot stop ntop: $!";
        and started again with:
        <br> my $start = `/usr/local/bin/sudo /usr/local/www/cgi-bin/ntop/ntop.sh s +tart` or die "cannot start ntop: $!";
        I cannot see errors on the ntop output.

        I have only one problem if the ntop is already running,
        an I start the script, I don't get any errors,
        but if it was stopped before,
        then I get an error:
        Software error: cannot stop ntop: at /usr/local/www/cgi-bin/ntop/ntop.cgi line 41.

        it needs to check first if the ntop is already running and then stop it.