I'm kind of new to bash scripting and I'm having trouble figuring out how to accomplish this.
I'm working on a script that is designed to backup and manage a java application that runs within a screen session. The goal is to be able to have multiple instances of the java application running on the different machines and to be able to control them over ssh from the script.
A feature I would like to have is the ability to easily call up the screen session of one of the java instances and display it to the user. So if the screen session is running on Machine A and I want to show it to the user on Machine B, I want to be able to initiate an ssh connection and call that up programmatically.
In short, I want to mimic the following user commands in a bash script:
ssh email@example.com screen -r ScreenName #Run from inside of ssh session