Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #243628

Re: why bash completion sometimes doesn't work?

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: why bash completion sometimes doesn't work?
Date 2022-01-03 13:30 +0100
Message-ID <DBuDn-8jx-5@gated-at.bofh.it> (permalink)
References <DBo4V-4oV-3@gated-at.bofh.it> <DBo4V-4oV-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jan 03, 2022 at 05:25:31AM +0000, Long Wind wrote:
> when i type "ifdown wl" and press Tab, it shall complete it with full device name wlx12345
> i believe it's taken from /etc/network/interfaces
> but sometimes it doesn't work in buster

You're describing "programmable completion", which is an optional
feature of bash.  It's done on a per-command basis.  E.g. if you
type "cd wlx<TAB>" it will not complete the wlx word using interface
names, because there is no such completion defined for the "cd" command.
Apparently there is (on your system) for "ifdown" though.

By default, Debian installs the bash-completion package, which contains
programmable completions for a whole bunch of commands.  This is
enabled by dotting in a file from ~/.bashrc (the code to do this is
at the end of /etc/skel/.bashrc, which becomes the default user ~/.bashrc
file if you add users with "adduser").

Unless told otherwise, we're going to assume you're using bash (not zsh)
as your shell, and that you've got the standard Debian ~/.bashrc file,
so that bash's programmable completion has been enabled.

If some programmable completion isn't working the way you expect, then
you need to gather some more information.  Give us the versions of
the bash and bash-completion packages that you've got installed, and
then tell us the EXACT command you typed, and what results you got by
pressing Tab.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

why bash completion sometimes doesn't work? Long Wind <longwind2@yahoo.com> - 2022-01-03 06:30 +0100
  Re: why bash completion sometimes doesn't work? Greg Wooledge <greg@wooledge.org> - 2022-01-03 13:30 +0100
    Re: why bash completion sometimes doesn't work? Richmond <richmond@criptext.com> - 2022-01-03 15:50 +0100
    Re: why bash completion sometimes doesn't work? Long Wind <longwind2@yahoo.com> - 2022-01-03 21:20 +0100
      Re: why bash completion sometimes doesn't work? Greg Wooledge <greg@wooledge.org> - 2022-01-03 21:30 +0100
      Re: why bash completion sometimes doesn't work? David Wright <deblis@lionunicorn.co.uk> - 2022-01-03 22:50 +0100
        Re: why bash completion sometimes doesn't work? Long Wind <longwind2@yahoo.com> - 2022-01-04 01:00 +0100
          Re: why bash completion sometimes doesn't work? Greg Wooledge <greg@wooledge.org> - 2022-01-04 03:30 +0100
            Re: why bash completion sometimes doesn't work? Long Wind <longwind2@yahoo.com> - 2022-01-04 03:50 +0100
              Re: why bash completion sometimes doesn't work? Greg Wooledge <greg@wooledge.org> - 2022-01-04 04:00 +0100
            Re: why bash completion sometimes doesn't work? David Wright <deblis@lionunicorn.co.uk> - 2022-01-04 20:40 +0100

csiph-web