strange behaviour: sed follows symlink when reading but not when writing on -i and without --follow-symlinks

Christoph Anton Mitterer <[email protected]>
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <[email protected]>
Hi.

The following is imho rather strange and should possibly be changed:

When doing a sed expression on a symbolic link and using -i, the 
symbolic link is afterwards removed and replaced by a regular copy of 
the (processed) file.

E.g.:

echo foo > regular
ln -s regular link
ls -al
sed -i "s/foo/bar/" link
ls -al


Now obviously there is --follow-symlinks... in which case, the sylink 
is not removed but correctly
But even if one argues, that the above behaviour is desired (which is a 
strange default IMHO), it's questionable why the symlink is followed 
(without --follow-symlinks) for reading, but not for writing.



Cheers,
Chris.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.