Am new to shell scripting, and it makes me wonder why the following snippet does not work in zsh but does in bash? Is there a zsh equivalent of the same snippet? I get error parse error near `200'
(
flock -e 200
echo "In critical section"
sleep 5
) 200>/tmp/blah.lockfile
echo "After critical section"
The above snippet of code is from src: https://stackoverflow.com/a/13551882/15087532
zsh
has a built-inflock
in itszsystem
module that would be better to use inzsh
scripts. – Kusalananda Sep 10 '21 at 05:40bash
uses for that purpose, but if you choose one of these fds, this would destroy the usability of that shell process. – schily Sep 10 '21 at 11:21