1 |
Piotr Jaroszyński <peper@g.o> posted |
2 |
d77765540906031651q55f93c07t78beb1191f3bf9b0@××××××××××.com, excerpted |
3 |
below, on Thu, 04 Jun 2009 01:51:01 +0200: |
4 |
|
5 |
> Where/when does :: need escaping? |
6 |
|
7 |
I'm not sure about this particular usage case as I haven't quite wrapped |
8 |
my mind around how to test it without it actually being at least stubbed |
9 |
into portage to test (not that I've spent too long trying, but given your |
10 |
question, a few seconds contemplation lead me to the conclusion that |
11 |
there was more to it than I might have than I thought), but bash |
12 |
completion at lest wants escaped colons in paths (and tab-completes them |
13 |
escaped with \), for instance, and shell scripts often use colons as |
14 |
field separators for filenames or paths as well, due to the relatively |
15 |
low frequency of use. |
16 |
|
17 |
It was the shell path stuff that I was thinking about when I cautioned |
18 |
about escapes. Maybe that doesn't apply in usage such as users would be |
19 |
using with portage? |
20 |
|
21 |
To confirm the above shell (well, shell completion) issues, I just |
22 |
created a dir ~/::test. Trying to tab-complete just a single colon |
23 |
produced unexpected results (either a listing of the entire parent dir, |
24 |
or :\:\:test, an extra colon, which naturally then failed to work |
25 |
as :::test didn't exist, depending on what I was tab-completing), while |
26 |
tab-completing a backslash escaped colon produced the desired results. |
27 |
|
28 |
Similar results if I tried to tab-complete a double-colon. When I tried |
29 |
to remove the ::test dir. rm -ri ::<tab> resulted in a completion |
30 |
of ::::test/, which of course gave me an error saying it couldn't |
31 |
find ::::test, but rm -ri \:<tab> completed correctly, and the rm |
32 |
succeeded. |
33 |
|
34 |
A retest typing in the entire name, ::test (thus NOT using tab- |
35 |
completion), however, worked correctly, so perhaps it's more accurate to |
36 |
say it's a bash-completion bug, while the shell itself works fine. Given |
37 |
that, we'd probably be OK at least until the gentoo-bashcomp update, and |
38 |
perhaps it could be worked around there. |
39 |
|
40 |
-- |
41 |
Duncan - List replies preferred. No HTML msgs. |
42 |
"Every nonfree program has a lord, a master -- |
43 |
and if you use the program, he is your master." Richard Stallman |