GNU「bash」シェルを実行しているLinuxマシン用のシェルスクリプトを「継承」しました。1つの特定のケースでは、マシンはGNU bashバージョン2.0.5bを実行します
これらのスクリプトの1つにはwait &、forループの「for line」の一部として(「アンパサンドを待つ」)命令があります。一見すると、それは奇妙な/興味深いイディオムのようですが、私のWeb検索で関連性のあるものは何も返されませんでした。man waitは、「BASH_BUILTINS」(「BASH BUILTINS COMMAND」)のマンページを示しています。
wait [n]  
  Wait for the specified process and return its termination status.
  n may be a process ID or a job specification;  if  a  job spec is given,
  all processes in that job's pipeline are waited for.  If n is not
  given, all currently active child processes are waited for, and the 
  return status is zero. If n specifies a non-existent process or job, 
  the return status is 127.  Otherwise, the return status is the exit 
  status of the last process or job waited for.
このマンページのその部分を読むとwait &、「現在アクティブなすべての子プロセスが待機され、戻りステータスがゼロである」ことを確認しているように見えます(バックグラウンドで)。私はこの解釈で正しいですか?これは一般的または有用なイディオムですか?
追加のコンテキストとして、私はスクリプトで次のような使用法について話しています。
for file in `ls *.txt ; wait &`
do
   ...
   [cp instructions]
   ...
   [mv instructions]
   ...
   [mailx instruction]
done