This is running me crazy:
I want to use 4 screen windows (within the same session) in a remote server (GCloud) to process 4 subjects in a parallel way.
Long story short:
- I first create a detached session:
gcloud compute ssh server --command "screen -dmS remoteSession"
- And then I use the following to (remotely) add a new window to that session and start the process. The last
screen -X other
is to avoid screen of changing my current window (kind of create a window in a detached mode).
gcloud compute ssh server --command "screen -x remoteSession -X screen -t window1 ping google.com; screen -X other"
*In this case I added the ping command instead of the huge command I use.
The problem is that this works when I type it in the shell, but not in the script. However, it works in the script when doing it on local (just doing the commands without the gcloud compute blabla
).
The remote session seems to be created just fine. But when executing the second step it just prompts No screen session found
.
Any ideas?