#!/bin/bashRET=0export RET{ssh -q -t  user@host <<EOFecho hello there exit 10EOFRET=$?echo Out is $RET} &echo RET is $RET################## EndI get RET 0OUT is 10How can I get correct exit status code in outer block. I need to see exit code 10.
Capture exit status code from ssh
shell script;exit