If I have a GNU screen session running, commands can generally be sent to it as follows:
screen -X 'exec echo hi'
However, I need a command to execute within
the shell. How is that done? E.g., to set a variable, one might be tempted to run:
screen -X 'exec export MYVAR=something'
This is obviously useless when the command executes in a subshell which exits.