bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strange behaviour: sed follows symlink when reading but not when writing


From: Christoph Anton Mitterer
Subject: strange behaviour: sed follows symlink when reading but not when writing on -i and without --follow-symlinks
Date: Wed, 27 Jun 2012 16:07:21 +0200
User-agent: Roundcube Webmail/0.6

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]