Bash – capture exit code / result of last command

root@wintermute:/nfs# /etc/init.d/dnsmasq start
* Starting DNS forwarder and DHCP server dnsmasq [ OK ]
root@wintermute:/nfs# echo $?
0

Yes. All is well.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.