A few observations. 

First, the ping line in Jack's script surely should read:

        system ("ping -c 1 $host");

so it sends only one ping packet instead of an unending stream of them.

Second, perl has "sleep" built in, so that line *can* read 

        sleep $sleep"  ; }

(though the way Jack wrote it does work).

Third, if the program is run in the background (./alive &), won't the
"print" line block and stop the program from continuing to execute until it
is re-attached to a console?

At 11:08 AM 8/1/00 -0500, Jack Barnett wrote:
...
>Also a quick perl script works, I have one on my system that looks something
>like this (IIRC):
>
>
>#!/usr/bin/perl -w
>
>$sleep = "180"; $host = "myisp.net";
>while (1 == 1)
> { system ("date");
>    system ("ping $host");
>    print ("Staying Alive, Staying Alive, o o o yea, Stayiiiiiiiing
>Alliveeeeee\n");
>    system ("sleep $sleep"); }
>
>Then run it with something like
>
>./alive &

--
------------------------------------"Never tell me the odds!"---
Ray Olszewski                                        -- Han Solo
Palo Alto, CA                                    [EMAIL PROTECTED]        
----------------------------------------------------------------


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to