I need to launch a command that will:
- login to a server
- Go to a specific directory
- attach a screen environment (already set up)
- start another command (does not really matter)
I tried doing this:
ssh {login}@{server} "cd /Where/I/Need/To/Be; screen -r MyScreenSession; MyFinalCommand"
Everything works fine but attaching to the screen session.
How can I fix it?