Piotr Jaroszyński <pe...@gentoo.org> posted
d77765540906031651q55f93c07t78beb1191f3bf...@mail.gmail.com, excerpted
below, on  Thu, 04 Jun 2009 01:51:01 +0200:

> Where/when does :: need escaping?

I'm not sure about this particular usage case as I haven't quite wrapped 
my mind around how to test it without it actually being at least stubbed 
into portage to test (not that I've spent too long trying, but given your 
question, a few seconds contemplation lead me to the conclusion that 
there was more to it than I might have than I thought), but bash 
completion at lest wants escaped colons in paths (and tab-completes them 
escaped with \), for instance, and shell scripts often use colons as 
field separators for filenames or paths as well, due to the relatively 
low frequency of use.

It was the shell path stuff that I was thinking about when I cautioned 
about escapes.  Maybe that doesn't apply in usage such as users would be 
using with portage?

To confirm the above shell (well, shell completion) issues, I just 
created a dir ~/::test.  Trying to tab-complete just a single colon 
produced unexpected results (either a listing of the entire parent dir, 
or :\:\:test, an extra colon, which naturally then failed to work 
as :::test didn't exist, depending on what I was tab-completing), while 
tab-completing a backslash escaped colon produced the desired results.

Similar results if I tried to tab-complete a double-colon.  When I tried 
to remove the ::test dir.  rm -ri ::<tab> resulted in a completion 
of ::::test/, which of course gave me an error saying it couldn't 
find ::::test, but rm -ri \:<tab> completed correctly, and the rm 
succeeded.

A retest typing in the entire name, ::test (thus NOT using tab-
completion), however, worked correctly, so perhaps it's more accurate to 
say it's a bash-completion bug, while the shell itself works fine.  Given 
that, we'd probably be OK at least until the gentoo-bashcomp update, and 
perhaps it could be worked around there.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


Reply via email to