thegitfather
5/7/2017 - 4:22 PM

assign exit code of a sub shell command to a variable

assign exit code of a sub shell command to a variable

ALIVE=$(ping -c 3 www.example.com &>/dev/null ; echo $?)