When I change files in cygwin bash with the sed command, the file gets locked.
cdto non-user directory (f.e.
echo aaa > test.txt
- Open in texteditor, add line, try to save => works
%CYGWIN_HOME%\bin\bash -c "sed -i 's/aaa/bbb/' test.txt"
- In texteditor, add another line and try to save => "Access denied"
WTF?! How can I sed a file without locking, or release the file handles afterwards?
Windows security permissions appear to be completely screwed on file:
It works however in user directory (
- I checked the file with LockHunter but no process appears to lock the file
- Cygwin FAQ mentions interferences with some programs. It tried uninstalling Antivir and Catalyst and rebooting.
UnxTools(crashes), GnuWin32(sed doesn't support inplace substitution), Interex(installer doesn't support W7 Pro) ... * sigh *