I'm quite new to bash scripting and i was having a look at permissions and i was wondering if there was a way to use a while loop to make it so that whilst the user is opening say
"file.txt" it becomes read only to everyone else until that file has been closed by the user again.
Is this possible in linux?