1

I have a long-running process command and I am splitting it into 10. This is why I am trying to run 10 commands instead of 1 using screen. If I open the screen manually and run those commands one after another then it is going fine. But I want to automate the task. This is why I wrote the following shell script. Unfortunately sometimes a few of the screens not loaded automatically.

screen -dmS Screen01
screen -S Screen01 -p 0 -X stuff 'Some command that run for more than 20 hours\n'

screen -dmS Screen02 screen -S Screen02 -p 0 -X stuff 'Some command that run for more than 20 hours\n'

screen -dmS Screen03 screen -S Screen03 -p 0 -X stuff 'Some command that run for more than 20 hours\n'

screen -dmS Screen04 screen -S Screen04 -p 0 -X stuff 'Some command that run for more than 20 hours\n'

screen -dmS Screen05 screen -S Screen05 -p 0 -X stuff 'Some command that run for more than 20 hours\n'

screen -dmS Screen06 screen -S Screen06 -p 0 -X stuff 'Some command that run for more than 20 hours\n'

screen -dmS Screen07 screen -S Screen07 -p 0 -X stuff 'Some command that run for more than 20 hours\n'

screen -dmS Screen08 screen -S Screen08 -p 0 -X stuff 'Some command that run for more than 20 hours\n'

screen -dmS Screen09 screen -S Screen09 -p 0 -X stuff 'Some command that run for more than 20 hours\n'

screen -dmS Screen10 screen -S Screen10 -p 0 -X stuff 'Some command that run for more than 20 hours\n'

Sometimes it there is Screen07 missing sometimes Screen04 missing and sometimes multiples are missing.

How can I automate this process?

0 Answers0