Why can't & and ; be used together (two processes started, first in the background)?
0
votes
2
answers
81
views
I tried this simple test
ping [SOME IP] &;ls
expecting the output of ping to overlap with the listing.
Instead, I got an error:
> bash: syntax error near unexpected token `;'
It does not help adding spaces. If the semicolon is escaped, the first command starts, then error
> ;: command not found
It almost works to enclose the ping in brackets
(ping [SOME IP] &);ls
The ls
runs to completion, then the ping
starts. I could achieve that more easily by typing
ls;ping ...
Is it possible to start two processes together, when the first (or both) are in the background?
Asked by Peter Bill
(526 rep)
Feb 20, 2025, 09:31 AM
Last activity: Feb 20, 2025, 12:57 PM
Last activity: Feb 20, 2025, 12:57 PM