Hi,
I've noticed the following unexpected behaviour in `ln` which appears to
be a bug. I'm referring to the attached MWE Bash script
test_ln-symbolic-interactive-relative.sh.
When run, it creates a directory "test_dir" and a file "test_file" in
the current working directory. Then it tries to create a relative,
symbolic link to the file in said directory. When the "--interactive"
option is present, this operation fails every other time in that it
overwrites the existing link with an unreachable target.
DETAILED DESCRIPTION:
* First invocation
$ ./test_ln-symbolic-interactive-relative.sh
ln -sirv test_file test_dir/test_link
‘test_dir/test_link’ -> ‘../test_file’
* Second invocation:
$ ./test_ln-symbolic-interactive-relative.sh
ln -sirv test_file test_dir/test_link
ln: replace ‘test_dir/test_link’? y
‘test_dir/test_link’ -> ‘test_file’
* Third invocation:
$ ./test_ln-symbolic-interactive-relative.sh
ln -sirv test_file test_dir/test_link
ln: replace ‘test_dir/test_link’? y
‘test_dir/test_link’ -> ‘../test_file’
AFFECTED SYSTEM:
* ln (GNU coreutils) 8.21
* GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
* Ubuntu 14.04.4 LTS