Hi Gordon,
On Wed, 29 Aug 2018 17:59:58 -0700 Gordon Messmer gordon.messmer@gmail.com wrote:
On 08/29/2018 09:22 AM, wwp wrote:
On Wed, 29 Aug 2018 08:27:06 -0700 Gordon Messmer <gordon.messmer@gmail.c
om> wrote:
On 08/28/2018 11:33 PM, wwp wrote:
- it doesn't expand *foo whereas there are *foo-named files in curre
nt dir, for instance:
# rm *foo will show nothing whereas there's a file barfoo in curdir.
Tab completion finishes a single word, given a string that appears at th
e beginning of a list of candidates.
Wrong, tab completion proposes the list of candidates if there are several, and it only finishes a single word automatically if there's only one match for the pattern. At least I never experienced tab completion how you're describing it.
Perhaps a miscommunication. What I mean is that tab completion's final outcome would be a single word, though it can suggest multiple candidates if there are several with matching prefix strings.
Wildcard expansion (Ctrl+x, e) will expand a word containing a wildcard to multiple words on the command line, usually so that you can remove some matches.
Neither will do specifically what you're trying to do, as far as I know.
I think it's simply too ambiguous.
This works fine in CentOS 6
$ docker run -i -t --rm centos:6 /bin/bash --login [root@9880736fa3ce ~]# touch 1.foo-named [root@9880736fa3ce ~]# touch 2.foo-named [root@9880736fa3ce ~]# ls *.fo
Tab completion doesn't work the way you're suggesting, on CentOS 6. It's possible that such a feature exists in some shell, but not one that I'm aware of.
Hah. You may laugh, but talking about mis-communication, you're definitely right. In my former saying "there are *foo-named files in current dir", I didn't mean that I had files like: 1.foo-named 2.foo-named but files named like *foo (IOW, maching the pattern *foo), id est: 1.foo 2.foo (my use of "-named" was confusing obviously) thus, from `ls *foo<TAB>` I was expecting: 1.foo 2.foo I well know that to match "1.foo-named", I should use `ls *foo*<TAB>` (trailing *) and I'm sure that you know that `ls *foo<TAB>` matches 1.foo.
I think we did now understand each other? ;-) to me, the subject is over, I've did `complete -r` and voila.
Regards,