How to run the first process from a list of processes stored in a file and immediately delete the first line as if the file was a queue and I called ‘pop’?
I’d like to call the first command listed in a simple text file with \n as the separator in a pop-like fashion:
Figure 1:
cmdqueue.lst : proc_C1 proc_C2 proc_C3 . .
Figure 2:
Pop the first command via popcmd:
proc_A | proc_B | popcmd cmdqueue.lst | proc_D
Figure 3:
cmdqueue.lst : proc_C2 proc_C3 proc_C4 . .
pop-cmd.py:
Example: