On 12/3/16 6:41 AM, Ravi (Tom) Hale wrote: > Bash Version: 4.4 > Patch Level: 5 > Release Status: release > > > Description: > ------------ > Given a filename called ':example' > When the user enters 'command :' and hits <tab> > Then the completion of the filename gets a doubled colon, specifically: > ':\:example' > > > Repeat-By: > ---------- > Create a filename beginning with a ':' character: > > $ touch :example > > Type `rm :` and hit tab, then enter. > > I'd expect to see: > > rm :example > [rm silently deletes it]
This has come up many times over the years. Here's one from 2003: http://lists.gnu.org/archive/html/bug-bash/2003-01/msg00088.html Question E13 in the Bash FAQ answers it. The short answer is that colon is special to readline: it breaks words for the readline completion code. If you want to complete filenames beginning with a colon, either quote the colon or remove colon from $COMP_WORDBREAKS. If you're using bash-completion, it may have its own problems with colons. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/