assign exit code of a sub shell command to a variable
ALIVE=$(ping -c 3 www.example.com &>/dev/null ; echo $?)