Red Hat Bugzilla – Bug 177250
Bash completion mishandles colon characters
Last modified: 2007-11-30 17:11:20 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; MSIE 6.0; Windows; U; AIIEEEE!; Win98; Windows 98; en-US; Gecko masquerading as IE; should it matter?; rv:1.8b) Gecko/20050217
Description of problem:
For some reason bash treats a colon in a filename in a different way to other charcters, even though it is neither a glob'able, directory separator, or in any other way a special character (except in certain contexts such as variable expansion etc).
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. cd /some-directory-containing-many-files
2. touch a:b
3. ls a:<TAB> OR ls a:<CTRL-D>
Actual Results: Display all 654 possibilities? (y or n)
Expected Results: Display all 1 possibilities? (y or n)
You must have filename-completion enabled in bash (see your ~/.inputrc or /etc/inputrc).
This behaviour is intentional, for convenience when setting PATH-like variables.
(Of course, you can escape it: ls a\:<TAB>)
How strange ... "... for convenience when setting PATH-like variables".
Let's think this through carefully.
There you are, at a shell prompt, setting your PATH, using filename-completion.
I wonder how often people do that, compared to the number of times a filename
has a colon in it! LOL!
This is intentional behaviour.