by teddyh · 4y ago · 0 comments
Why? The colon character is not a special character in shell commands.
I'm running bash I have to escape it otherwise the shell doesn't autocomplete.
But ls/vim seems to be fine with the path without escaping so I guess I'm wrong.
Anyway, another problem is: ~/git/git.chown.me/ipam (master %=)$ vim ipv6/2a0e\:f43\:\:-48/2a0e\:f43\:<tab><tab> I get: 2a0e:f43:0:100:-56/ 2a0e:f43:0:fd00::-56/ 2a0e:f43:0:fe00::-56/ 2a0e:f43:0:ff00::-56/ 2a0e:f43::-56/
it's a mess to find the difference between the possibility haha
Tab-completion is probably being conservative about escaping it in case you're using it as a path separator, like when setting a `$PATH`-like var.
: is special on NTFS for alternative data streams, and I think HFS+ named forks? (The mac syntax is foo/..namedfork/rsrc, I don't know how that translates to linux)
"foo\:bar" is a file name with a colon in it. "foo:bar" is an ADS named bar on the file foo.
bash added `:` to the list of completion word break characters with bash 2.0 [1][2]. Bash 2.0 was released in 1996. NTFS-3G started in 2006 but it was "forked from the Linux-NTFS", and I can't find any history for this project. NTFS itself was released in 1993.
HFS+ seems to have been released in 1998, so it can't be the reason. But even regular HFS had resource forks and it was released in 1985.
No idea where to look in ksh's source.
[1]: https://github.com/bminor/bash/commit/ccc6cda312fea9f0468ee6...
[2]: https://github.com/bminor/bash/commit/ccc6cda312fea9f0468ee6...
That does not make sense. The shell does not itself know anything about ADSs, and therefore, in both cases, sends the string "foo:bar" as arguments to commands.
https://stackoverflow.com/questions/7444504/explanation-of-c...
Contrast this with the characters $, [, (, etc.