Current status: implementing read-write locks in bash.

Regretting my life choices right now.

@siguza Not as bad as it seems. I used the pattern
{
flock -x NN
# whatever you want to do
} NN< FILENAME
where NN and FILENAME are the file handle and name