Reputation: 3197
I want to run multiple commands in one line, and one of them have to run in background.
Script like that:
cd /tmp; python -m SimpleHTTPServer &; echo "Hello"
I want to cd
to /tmp directory, and then brings up the python simplehttpserver in the background, on the same time run echo "Hello"
, but it turns out
syntax error near unexpected token `;'
What should I do?
Upvotes: 1
Views: 673
Reputation: 1235
The &
is already separator in sh/bash. Does this do what you want?
cd /tmp; python -m SimpleHTTPServer & echo "Hello"
You can also try eval
cd /tmp; eval "python -m SimpleHTTPServer &" ; echo "Hello"
Upvotes: 1