I have a text file that contains 100 bash commands and i want to execute every 5 in a new screen , but I don't know if I can use "for" in this case .
For example we have those commands :-
mkdir 1
cd 1
rm -rf 1.txt
rm -rf 2.txt
cd ..
mkdir2
...
I want to create a new screen and send the first 5 commands to it to be executed and then send the other 5 to another screen to the end of the file .
How I can do that ? any help please with the coding ?