On Jan 10, 2008 8:04 AM, Marcel Preda <[EMAIL PROTECTED]> wrote:
>
> --- Laurentiu STEFAN <[EMAIL PROTECTED]> wrote:
>
> > PC0="10.0.0.34"
> > PC1="10.0.0.2"
> >
> > retvalPC0=$(ping -c $c -i $i ${PC0} 2>/dev/null | echo $? );
> >     echo $retvalPC0 $PC0
> > retvalPC1=$(ping -c $c -i $i ${PC1} 2>/dev/null | echo $? );
> >     echo $retvalPC1 $PC1
> >
> > Ambele imi dau valoarea 0 chiar daca exista shiar daca nu...
>
> eh, unorale place cu cit mai multe pipeuri si redirectari...
>
>
> $? == codul de exit al ultimei comenzi
>
> Incearca:
>
> ping -c $c -i $i ${PC0} 2>&1 >/dev/null
> retValPC0=$?
> echo $retValPC0 $PC0

Nu iti trebuie nici o variabila:
ping -c 3 1.2.3.4  2>&1 >/dev/null || echo Nu mere
ping -c 3 1.2.3.4  2>&1 >/dev/null && echo Mere

sau:
if ping -c 2 1.2.3.4  2>&1 >/dev/null;then echo mere; else echo nu mere;fi

>
> PM
>
>
>
>       
> ____________________________________________________________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.  
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
>
>
> _______________________________________________
> RLUG mailing list
> RLUG@lists.lug.ro
> http://lists.lug.ro/mailman/listinfo/rlug
>

_______________________________________________
RLUG mailing list
RLUG@lists.lug.ro
http://lists.lug.ro/mailman/listinfo/rlug

Raspunde prin e-mail lui