ssh remotecluster \'bash -s\' << EOF > export TEST=\"sdfsd\" > echo $TEST > EOF
This prints nothing.
Also it still does not
export variable, ssh send exported(environment) variables to server export VAR=test ssh -v 127.0.0.1 echo $VAR test above commands and see result