我想在一行中运行多个命令,其中一个必须在后台运行。
这样的剧本:
cd /tmp; python -m SimpleHTTPServer &; echo "Hello"
我想cd
到 / tmp 目录,然后在后台运行python simplehttpserver,同时运行echo "Hello"
,但事实证明< / p>
syntax error near unexpected token `;'
我该怎么办?
答案 0 :(得分:1)
{/ 1}}已经是sh / bash中的分隔符。这样做你想要的吗?
&
您也可以尝试cd /tmp; python -m SimpleHTTPServer & echo "Hello"
eval