I have several bunch of commands writen in bash contained in a text file, separated by \n\n and I would like to automatically paste each in given screen processes. For the sake of clarity, let's say my command.txt simply contains :
#first bunch of commands:
executable_script1.sh
mv executable_script1 directory1
#second bunch of commands:
executable_script2.sh
mv executable_script2 directory2
So the first bunch of commands would run executable_script1.sh, after what it will move executable_script1. In this example, my screen contains 3 processes:
0$ htop
1$ bash
2$ bash
The name of the processes is irrelevant, the only important information is that I would like commands N in screen process N$, as 0$ is always a htop.
As for now, I have been copying/pasting manually each bunch of commands in the corresponding screen processes, which worked obviously, but now I will be dealing with more than 40 bunch of commands and as many screen processes. So, how could I paste the commands N to the N$ screen terminal automatically? I think a bash/shell script could do the trick, but I am not fluent enough with it. Mind that I could create one txt file by bunch of commands if needed.
Could you help me with this? Please feel free to ask for any missing information.