I am specifically looking on the return variables of running ping on my Ubuntu server, the variables I am looking for is: error status, output on stdout, output on stderr.When pinging a host the following three scenarios can happen:The host answers on ALL packets (No error)The host answers on ZERO packets (Error)The host answers on SOME packets (Unspecified behavior)I have read through man ping, a couple of times and can't seem to find what I should expect in that situation. I have no way to test this, the only machines I have access to is a Linode virtual server running Ubuntu, and my Macbook running Snow Leopard (Probably not with the same PING program as my server)What should I expect as return variables from the third scenario?
Behavior of ping with partial packet loss on Ubuntu
linux;ubuntu;ping
Without knowing what language you are using to write your code in, it is difficult to give you specifics, but here is a small primer on outputs.error, stdout, stderr are not variables, but types of output that a unix binary can return.stdout - This is the standard text that a program outputs to the screen (in many cases) or file (if redirected) or another program, it can be captured usingprogram > filestderr - This is text that is outputted to the error stream, an second output that is not caputred by any redirection of the stdout stream.  You can capture this usingprogram 2> fileerror - This is the code returned from the program after it completes.  Success is usually indicated by a 0.  You can capture this using#!/bin/bashprogramecho $?You can find out more about streams at the Wikipedia page for Standard_Streams.There is good documentation of capturing streams in bash in the bash manual.