If you need to determine the return code for shell scripting, you can use “$?”
# ifconfig | grep eth0 >/dev/null 2>&1 # echo $? 0 => good/found
# ifconfig | grep eth1111 >/dev/null 2>&1 # echo $? 1 => bad/not found
If you need to determine the return code for shell scripting, you can use “$?”
# ifconfig | grep eth0 >/dev/null 2>&1 # echo $? 0 => good/found
# ifconfig | grep eth1111 >/dev/null 2>&1 # echo $? 1 => bad/not found
by
Tags:
Leave a Reply