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

David Paleino d.paleino at gmail.com
Wed Jan 28 21:30:54 UTC 2009


On Sat, 24 Jan 2009 21:52:45 +0200, Ville Skyttä wrote:

> Hello,

Hello Ville,

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

Thanks for looking at old changes too! :-)

> 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?

Line 84, contrib/ssh -- but I suppose you already know that.

> 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?

Yes, or at least I believe so. I'd wait for others to comment on this as well.
The fact is (I can't remember it right now, studying for exams and can't recall
if it's doable or not -- and that's why I can't decipher what that sed hack is
doing either): can we reliably find whether it's a local path?

Sure one can say that /\w+.*/something/ surely isn't remote and also ~/.*,
and we can handle just those two.

My two tired-from-back-to-home-trip cents,
David

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20090128/ddba905d/attachment.pgp 


More information about the Bash-completion-devel mailing list