Performing atomic write operations in a file in bash
19
votes
2
answers
13323
views
After going through the bash documentation , this question and this one it's still not clear to me how can I perform atomic write (append) operations to a file in bash. I have a script that is run in multiple instances and at some point must write data to a file:
echo "$RESULT" >>
pwd
/$TEMP_DIR/$OUT_FILE
How is it possible to make all write operations from all concurrently running scripts to that file atomic (so that data from one instance doesn't overlap data from another)?
Asked by Sebi
(1029 rep)
Apr 5, 2016, 05:17 PM
Last activity: Oct 15, 2018, 01:26 PM
Last activity: Oct 15, 2018, 01:26 PM