Hi, ygemici:
Quote:
Originally Posted by
ygemici
I can try different sed on freebsd or solaris and old system if i can find any chance..I work on GNU sed 4.1.5..ok
Did you try your earlier "sed -i" example but as a non-root user with read permissions but who is not the owner?
I found an old pentium 2 laptop with a circa 2006 Debian install, which also happens to have GNU sed 4.1.5; I tried `sed -i` and it did indeed change the file's ownership as expected (User A owned the file, User B ran the sed command, ownership changed from A to B, neither user was root).
Also, oddly, your 4.1.5 seems to support a -c flag (which was also mentioned earlier by the original poster), but my 4.1.5 does not. There is no mention of it at
Invoking sed - sed, a stream editor nor did I see any sign of it in the option handling source code of gnu sed 4.1.5 and 4.2 (which I downloaded from
Sed - Free Software Directory - Free Software Foundation). The only mention I can find is at
sed(1) - Linux man page
Perhaps I need to have my eyes checked, but I'm totally lost with regard to the origin of the -c flag (there is also no mention of it in the man pages of OpenBSD, NetBSD, FreeBSD, OSX, Solaris, POSIX, HP-UX, AIX). If anyone can shed some light on it, I'd be curious to know what's going on (even though I seldom use a GNU userland).
Regards,
alister