[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Flock Explanation



Thank you for the help rbmj.

On 23/05/2012 19:02 PM, rbmj wrote:
a lock, in this case). It then exits the subshell (the section
surrounded by () parens).

What is the effect of exit codes in the script code section? Does an exit 0(1,2...) exit just the subshell or the entire script? I am worried by a lock being left in place by one of these.

The > redirector is redirecting file descriptor 200 to the file you are
specifying. In this case, I think that the choice of 200 is arbitrary.
As long as you redirect the same file descriptor that you pass to flock,
then the number shouldn't matter (though don't choose stdout :D)

So it is not actually creating the lock file? So I must make sure the lock file exists in advance?

Kindest Regards

Craig A. Adams


Reply to: