Knowing how to work with and display exit codes on the Linux command line or in scripts can help make errors more obvious. Exit codes on the Linux command line are numeric values that provide feedback ...
isnt $? expanded inside the double quotes before being passed to the subshell, like any other variable? iow it's reporting the status from the previous echo command. try single quotes, or maybe i'm ...
There are quite a few exit codes used on Linux systems, though no listing you can display when you’re feeling curious. In fact, you won’t see the numeric codes unless you specifically ask for them.