How to edit processes queued using && in Linux/bash?

Viewed 121

Lets say I have 3 processes queued in a Linux/Shell terminal by separating the commands for respective processes using && as follows:

<command1> && <command3> && <command4>

Now while command for process1 was being executed, I want to edit the queue:


e.g. 1: I want to have another process2 in between process1 and process3. So that the updated command queue becomes:

<command1> && <command2> && <command3> && <command4>

e.g. 2: Or may be remove a process for e.g. process3 from the queue. So that the updated command queue becomes:

<command1>  && <command4>

Is there a way to edit the command queue on the fly? i.e. when the process1 is already being executed?

3 Answers
Related