I have a C application that returns a value to the shell.
I can get this value from the shell by using
echo $?
but, when I use it in the following way, I always get 0 even when status is not 0:
c_app | mutt -s "$?" email.address
mutt is a mail program, -s "subject line"
What is overwriting $? ?