On 16 October 2017 at 13:23, João Eiras <joao.ei...@gmail.com> wrote: > Howdy. > > An issue bit me recently. Consider the following: > > $ cd > $ mkdir -p realfolder/subfolder > $ ln -s realfolder linkedfolder > $ cd linkedfolder > $ realpath --no-symlinks blah > /home/.../realfolder/blah > $ cd subfolder > $ realpath --no-symlinks blah > /home/.../linkedfolder/subfolder/blah > > The first call to realpath resolves the relative path to "blah" to be > an absolute path, but it is resolving symlinks for the current working > folder (.) even though --no-symlinks is given. > > The second call happens inside a subfolder, not directly inside the > linked folder and realpath is no longer resolving the symlinks for > that one.
I forgot to tell, I tried the above in cygwin with coreutils 8.26 Meanwhile I tried in linux with coreutils 8.25 and I get $ cd linkedfolder $ realpath --no-symlinks blah /home/.../realfolder/blah $ cd subfolder $ realpath --no-symlinks blah /home/.../realfolder/subfolder/blah So, in this case (linux and coreutils 8.25) the behavior is consistent, but it still resolves symlinks against the --no-symlinks option. Is this by design ? Thank you.