sed-4.2.1 替换文件内容后变成只读文件

D:\zDown\00>cat test.txt
000
111
222
333

D:\zDown\00>attrib
A       I            D:\zDown\00\test.txt

D:\zDown\00>sed -i -e "s/$/&TTT/g" test.txt
sed: preserving permissions for `./sed003936': Permission denied

D:\zDown\00>attrib
A    R               D:\zDown\00\test.txt

D:\zDown\00>cat test.txt
000TTT
111TTT
222TTT

D:\zDown\00>sed --version
GNU sed version 4.2.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.

GNU sed home page: <http://www.gnu.org/software/sed/>.
General help using GNU software: <http://www.gnu.org/gethelp/>.
E-mail bug reports to: <bug-gnu-utils@gnu.org>.
Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.

D:\zDown\00>

 今天遇到的问题,百思不解为何,后来换个sed-4.2.2 版本试了一下html

D:\zDown\00>attrib -R +I

D:\zDown\00>attrib
A       I            D:\zDown\00\test.txt

D:\zDown\00>cat test.txt
000TTT
111TTT
222TTT

D:\zDown\00>sed-4.2.2 -i -e "s/$/&TTT/g" test.txt

D:\zDown\00>attrib
A       I            D:\zDown\00\test.txt

D:\zDown\00>cat test.txt
000TTTTTT
111TTTTTT
222TTTTTT

D:\zDown\00>sed-4.2.2 --version
sed-4.2.2 (GNU sed) 4.2.2
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
and Paolo Bonzini.
GNU sed home page: <http://www.gnu.org/software/sed/>.
General help using GNU software: <http://www.gnu.org/gethelp/>.
E-mail bug reports to: <bug-sed@gnu.org>.
Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.

D:\zDown\00>

sed-4.2.2 就正常,发现MSYS自带的sed版本确实有这个BUGredis