"ln -sf" fails to replace existing target, if it is a symlink to a directory
Bug #120902 reported by
Daniel Hahler
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
coreutils (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: coreutils
When using "ln -sf DIRECTORY SYMLINK-
Recipe:
$ mkdir foo1
$ mkdir foo2
$ ln -sf foo1 bar
$ ls -l
bar -> foo1/
foo1/
foo2/
$ ln -sf foo2 bar
$ ls -l
bar -> foo1/
foo1/
foo2/
To post a comment you must log in.
Wow. "it does nothing was wrong", using -v shows that:
$ LANG=C ln -sfv foo2 bar
create symbolic link `bar/foo2' to `foo2'
So it creates the symbolic link in the directory linked to by "bar".
Is this expected behaviour?
(Note that I do not have used a trailing slash at the end of the target name, which e.g. "rm" uses to distinguish between deleting the symlink or the directory.)