Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在后台 运行我的bash脚本的一些实例。foo.bash
bash
foo.bash
当我在命令行中写入for i in {1..10}; do ~/bin/foo.bash & ; done时,出现错误:bash: syntax error near unexpected token ;
for i in {1..10}; do ~/bin/foo.bash & ; done
bash: syntax error near unexpected token ;
您能否解释为什么会发生此错误以及如何修复该命令?
&并且;都是命令分隔符;你不需要(也不能拥有)两者。
&
;
for i in {1..10}; do ~/bin/foo.bash & done