I have a
screen instance running (a lot more actually, but only one that matters), and I would need to execute some code inside the
screen, and get the result out to my script.
The first part is quite easy, I just
screen -S session_name -X eval 'stuff "$cmd"\015'.
screen expert, I just modified a line I found in a script, but I understand it... Not sure there's no better way to do it, though)
The second part, getting out the output, is trickier. For my current need, I only need the last line, but it'd be better if I can get the whole output, whatever it's size (for future uses).