Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Why do you have the parentheses creating a sub shell? I could not think of a case where I would need them, the code seems to work just fine without the parentheses Commented Sep 9, 2021 at 21:55
  • @reportaman from the docs "The lock terminates when the shell process that created the lock exits; it is therefore often convenient to create file locks within subshells, since the lock is automatically released when the subshell exits." Commented Jun 1, 2022 at 21:17