When I execute a command as below it gives me an output as expected but when I run the same command on remote server it always gives me
echo $? as
locally # <some command> # echo $? Remotely # ssh server " <some command >; echo $? "
Now in case of remote execution I always get
echo $? output.