#506973 bash-completion: soft link completion is broken

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Noah Slater
Date:
2024-06-03 15:15:03 UTC
Severity:
minor
Tags:
#506973#5
Date:
2008-11-26 16:00:52 UTC
From:
To:
Bash completion fails to account for soft links properly:

  nslater@mahora: ~ $ mkdir -p dir-a/dir-b
  nslater@mahora: ~ $ ln -s dir-a/dir-b dir-c
  nslater@mahora: ~ $ touch doc-a
  nslater@mahora: ~ $ touch doc-b
  nslater@mahora: ~ $ cd dir-c
  nslater@mahora: ~/dir-c $ cat ../doc-
  doc-a doc-b
  nslater@mahora: ~/dir-c $ cat ../doc-a
  cat: ../doc-a: No such file or directory
  nslater@mahora: ~/dir-c $ cat ../doc-ab
  cat: ../doc-b: No such file or directory

#506973#12
Date:
2008-11-26 20:07:05 UTC
From:
To:
tags 506973 confirmed
thanks

Hello Noah,

This is because it considers "dir-c" as a sibling of dir-a, not as
dir-a/dir-b. :(

I don't know whether this is fixable or not. Will have a look.

Thank you for your report.

Kindly,
David

#506973#21
Date:
2010-05-26 10:31:59 UTC
From:
To:
Hello

A quite old bug, but I may have more precise informations
way to reproduce:
pablo@desky:~$ mkdir symlink
pablo@desky:~$ touch toto
pablo@desky:~$ ln -s symlink /tmp/newlink
pablo@desky:~$ touch tmp/tutu
pablo@desky:~$ cd /tmp/newlink
pablo@desky:/tmp/newlink$ cat ../
tutu
pablo@desky:/tmp/newlink$ cat ../tutu
cat: ../tutu: No such file or directory

it looks like bash-completion just looks at the apparent directory structure, and does not follow the target of the links.
On the upper example, it checks into /tmp directory instead of checking into $HOME.

#506973#26
Date:
2011-04-25 11:59:20 UTC
From:
To:
Heya,
these (#267060 and #506973) are bugs in bash, which it seem aren't going to be
fixed anyway, so I'm closing them.

David

#506973#31
Date:
2011-04-25 11:59:20 UTC
From:
To:
Heya,
these (#267060 and #506973) are bugs in bash, which it seem aren't going to be
fixed anyway, so I'm closing them.

David