gow icon indicating copy to clipboard operation
gow copied to clipboard

sed creates residue temp files with the -i flag.

Open Laufire opened this issue 10 years ago • 4 comments

The command

$ sed -i s/search/replace/g

creates a temporary file in the working dir, named sed* and fails to clean it.

Laufire avatar Aug 31 '15 04:08 Laufire

I have the same issue, each time i need to clean it manually or add a "rm sed_" or "del sed_" command

edit: i don't know why the asterisks are gone while finished editing this comment, but there is an asterisk after the "sed"s

liangziqi124 avatar Oct 10 '16 14:10 liangziqi124

FYI: This is a long standing sed bug related to the Windows implementation of "unlink".

The same issue in GnuWin, from April 2003: https://sourceforge.net/p/gnuwin32/discussion/74807/thread/32b30873/

From Dec 2009: http://stackoverflow.com/questions/1823591/sed-creates-un-deleteable-files-in-windows

VkgeRepo avatar Jan 12 '17 18:01 VkgeRepo

Workaround for me on macos was to install gnu-sed with homebrew. I believe that was the solution, and then using sed -i ...... instead of sed -i.temp ...

campbellgoe avatar Nov 12 '19 19:11 campbellgoe

On Windows the issue appears to be solved in sed 4.8. The one in Gow is still 4.2.1. It would be nice to update it.

In meanwhile the workaround would be to install a standalone sed, for example using https://community.chocolatey.org/packages/sed choco install sed

nadya-p avatar Dec 17 '21 08:12 nadya-p