[Bash-completion-devel] _expand, scp and quoting

Ville Skyttä ville.skytta at iki.fi
Sat Jan 24 19:52:45 UTC 2009


Hello,

http://bzr.debian.org/loggerhead/bash-completion/current/revision/1170?

I don't think the above change is actually wrong but it has broken at 
least "scp ~/<TAB>" completion.  This is because the "ls" in _scp ends up 
being run as

    ls -aF1d '~/*' 2>/dev/null

...and obviously ls '~/*' practically never matches anything because of the 
single quotes bash inserted.  Before the above change there were no quoting 
problems because ~ was expanded to /home/foo which bash didn't need to 
enclose in single quotes.  We'd want the ls to be run without the quotes, 
like

    ls -aF1d ~/* 2>/dev/null

...but I don't know how to get bash to do that.  Ideas?

On the other hand, I wonder what's the point of the ls -aF1d and sed spaghetti 
when completing _local_ files for scp in the first place.  Wouldn't _filedir 
do just fine?

Based on briefly browsing the code (note testing), the same problem could also 
be in "cvs add" although it probably isn't much of a problem for it (at least 
for the "~/*" case).



More information about the Bash-completion-devel mailing list