blob: 3bd076c39d04e2bd8e6c833643b00e516389f950 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
Lock
====
This program creates a lock directory to ensure two programs do no simulaneously execute
example:
calvin@barnabas:~/lock$ lock p
calvin@barnabas:~/lock$ lock p && echo 'UNLOCKED' &
[2] 22844
calvin@barnabas:~/lock$ rmdir p
* two seconds later *
calvin@barnabas:~/lock$
UNLOCKED
[2]- Done lock p && echo -e '\nUNLOCKED\n'
calvin@barnabas:~/lock$
|