-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 19 June 2003 13:03, you wrote:
> Hello all,
>
> In man ping spune cam asa:
>      If ping does not receive any reply packets at all it will exit with
> code 1.  On error it exits with code 2. Otherwise it exits with code 0.
> This makes it possible to use the exit code to see if a host is alive or
> not.
>
> CU ALTE CUVINTE:
> #Exit code = 1 -> Host Down
> #Exit code = 2 -> Host Up but are some errors
> #Exit code = 0 -> Host Up
>
> Cum fac sa preiau intr-o variabila $exit_code?

ping a.b.c.d
echo $?

>
> Ma intereseaza sa analizez o retea, folosind acest feature al lui ping,
> ceva de genul:
>
> for ...
> do
> if `ping -c 3 -w 3 $network.$i &> /dev/null`;
>     then echo 'Host Up';
>     else echo 'Host Down or Host Up but are some errors';
> #iar aici sa detaliez (daca este Down sau este Up dar cu ceva erori)
> fi
> done
>
> Regards,
> Alex

- -- 
Cu respect/Best Regards,
Adrian Mazarache

Public key: http://london.forte.ro/mazasign.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+8Yt6Ebm/AUY3ZdkRAiduAJ466zgz2nb0cJBINt/LUrcxNLb2ggCfRo8I
l9bYjGiQj7X75n1aGsQQKko=
=33ou
-----END PGP SIGNATURE-----

Raspunde prin e-mail lui