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