I have cmd2
that needs to follow after cmd1
completes. I need to pause cmd1
sometimes.
I type in
$ cmd1 && cmd2
and then press Ctrl+Z (Stop)
to stop cmd1
. Now, cmd1
is paused but when I resume, it does not start cmd2
after completion of cmd1
.
I type in
$ cmd1 ; cmd2
and then I press Ctrl+Z (Stop)
to stop cmd1
. Now cmd1
is paused but it immediately starts cmd2
. However, I wish to start cmd2
only after cmd1
finishes.
I did some research and someone suggested an elegant way in zsh
but I wonder if there is an elegant way of doing it in bash
.
Run it in a subshell:
Example: