3
In ~jacksonc/temp/
there are two files, test.txt
and space test.txt
, both placed there through Windows (using Samba).
Using bash, if I type
cat ~jacksonc/temp/t[tab]
, it autocompletes to
cat ~jacksonc/temp/test.txt
However, if I type
cat ~jacksonc/temp/s[tab]
it autocompletes to
cat /home/jacksonc/temp/space\ test.txt
My question isn't about the backslash, I know why that's there. I'm curious as to why the space causes the ~ to be expanded though?
shrug it doesn't do the same thing for me (using bash 4.1.5 in Linux). It could just be a bug. – Flimzy – 2011-07-06T04:36:45.317
I doubt it. More likely it's a user setting, as Drav Sloan suggested. – Cam Jackson – 2011-07-06T05:11:31.573
Just to provide another data point, using the default settings on current Ubuntu,
bash
expands~
to the actual path when using tab completion regardless of whether there's a space in the path or not. I have no idea why the space would make a difference either; I've never heard of such a thing before. – Dave Sherohman – 2011-07-06T08:11:06.677Mmm. Unfortunately, I can't give too many details on the system I'm using, as my work uses its own internal Linux distribution, though I believe it's essentially re-badged Redhat from like, 6 years ago. – Cam Jackson – 2011-07-06T23:27:19.727
One extra thing though, is that ~ always expands upon tab-completion when in ksh, which is the default shell. But if I fire up bash it only happens with a space in the path. Weird. – Cam Jackson – 2011-07-06T23:34:14.213
Here on ubuntu 10.04, with bash_completion installed ~ with a space in the path does not expand. It is a bit of a weird one though! – Drav Sloan – 2011-07-09T13:00:24.167