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 ...