Linux – Why did ; after & return an unexpected token error in bash

bashlinux

I received the error:

bash: syntax error near unexpected token `;'

due to the following command:

evince foo.pdf bar.pdf &; emacs foo.tex &

I is it illegal to separate commands with ; when using & to background a job? Or is there another reason this didn't work?

Thank you.

Best Answer

You don't need the semicolon. After it's sent to the background it's free to get another command.

evince foo.pdf bar.pdf & emacs foo.tex &
Related Question