When I try something like
$command &; command2
, bash returns me
bash: syntax error near unexpected token `;'
How can I do that?
When I try something like
$command &; command2
, bash returns me
bash: syntax error near unexpected token `;'
How can I do that?
Both &
and ;
are command terminators. You use one or the other, but not both.
some_command1 & some_command2
some_commandA ; some_commandB
is the same as
some_command1 &
some_command2
some_commandA ;
some_commandB
... but the ;
is not needed when it's at the end of the line, so the second set of commands is the same as
some_commandA
some_commandB
&
is not only to detach but to end the "line" too, thanks!
– aaa
Jun 26 '21 at 12:02