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.

Required fields*

4
  • What does the last part of this snippet do: || : Commented Jan 21, 2021 at 19:43
  • 1
    @Mihail it means do nothing if test is false. In second example I use echo instead of colon on this place. Here are good description for colon operator stackoverflow.com/a/3224910/3132194 Commented Jan 22, 2021 at 11:30
  • Recommend this answer because it just lie in official manual, and no extra lock file is needed! Commented Aug 9, 2021 at 8:41
  • Be aware that by locking on the script file itself instead of a dedicated lock file you are risking situation where script gets replaced (updated or edited), therefore another copy successfully locks on new script file even though already running script is still locking the previous script version that was deleted. I used to run into this problem after package updates and/or script edits with vim. Commented Dec 9, 2021 at 3:17