次のタグが付いている話題の回答:

1

同じファイルに対するリダイレクション追記は排他が必要ですか?

以下の記事が参考になるかと思います。 Appending to a File from Multiple Processes Appending The first concern is solved by the operating system, with one caveat. On POSIX systems, opening a file with the O_APPEND flag ...
metropolis's user avatar
  • 4,995
1
Accepted

同じファイルに対するリダイレクション追記は排他が必要ですか?

回答 排他処理は不要だと思います。 Linuxでのechoなど標準出力への書き込みはシステムコールwriteを使っていますので、他のプロセスからの出力が重なっても結果が失われることはありません。 bashは標準出力をファイルにリダイレクトするとき、アペンドモードでファイルをopenしているのでファイルの末尾に追加されます。出力が混じることもないと思います。 以下調査結果です。 スクリプト(q....
akira ejiri's user avatar
  • 4,933

Only top scored, non community-wiki answers of a minimum length are eligible