Q:

Multiple command for bash shell script

I want to assign a variable after executing the set of commands
The first command is to get into the shell of the openshift pod. Then cat a file and assign that to a variable outside the openshift container.
I tried it like this
check=$(oc rsh pod << EOF
cat /var/lib/jenkins/.ssh/check.pub
EOF)

It gives me an error
bash: warning: here-document at line 41 delimited by end-of-file (wanted `EOF')

A:

I believe the second EOF needs to be on a line by itself:
check=$(oc rsh pod << EOF 
cat /var/lib/jenkins/.ssh/check.pub 
EOF
)

