I'd like to run chained commands but some are sequential and others are in background.
Running this command:
echo 1 && echo 2 & echo 3 && echo 4
I'd like to get:
1
2 (background)
3
4
But I get:
3
4
1
2
A more realistic example:
compile &&
run server & (background, used by tests below)
run test 1 &&
run test 2 &&
kill server
How can I do it using bash?
Thanks!