I would like to run a bash scrpit while using a screen session, here is my script :
#!/bin/bash
for i in 1 5 18 20
do
screen -S output_${i}
./run_my_program
screen -d
The problem is that the screen session does not detach using screen -d
(but detach with the keyboard shortcut ctrl-a d), any suggestion ?
Thanks.
./run_my_program
within the screen, but waits for the firstscreen
to return? Do you mean you want to start a detached screen session with some command? – ilkkachu Jul 27 '17 at 11:59