bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash tab variable expansion question?


From: Clark J. Wang
Subject: Re: bash tab variable expansion question?
Date: Fri, 25 Feb 2011 18:10:53 +0800

On Fri, Feb 25, 2011 at 1:15 PM, Eric Blake <address@hidden> wrote:

> On 02/24/2011 03:14 PM, Michael Kalisz wrote:
> > $ echo $PWD/<TAB>
> > will expand the $PWD variable to your current directory
> >
> > while in bash, version 4.2.0(1)-release:
> >
> > $ echo $PWD/<TAB>
> > will just escape the $ in front of the $ variable i.e:
> >
> > $ echo \$PWD/
> > The shell-expand-line (Ctrl-Alt-e) works but before I could use just TAB
> >
> > Any hints why? Any way to get the 4.1 behavior in 4.2?
> >
> > Can someone confirm... Is this a bug or a feature?
>
> I'm not the developer, but in my mind, this is a welcome feature.
> TAB-completion should NOT modify what I typed,


It's not true, see this discussion:
http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00163.html

> and I consider the 4.1
> behavior to be the bug.


I'd like to view it as a feature. ;)

> Consider if I have parallel directory
> structures a/c and b/c.  If I do:
>
> d=a
> $d/c/test
> d=b
> $d/c/test
>
> I want to run two different programs.  Now, instead of a one-letter
> name, consider that it is something longer, like $HOME.  If typing TAB
> expands the variable, instead of keeping it intact, then I can't do:
>
> $HOME/c/t-TAB
> $HOME=b
> UP-UP-ENTER
>
> to repeat my test in a new directory, since tab completion wiped out
> that I want to evaluate $HOME every time.  (The same goes for command
> substitution - bash should never pre-maturely lock me in to a single
> expansion during tab completion.)
>
> --
> Eric Blake   address@hidden    +1-801-349-2682
> Libvirt virtualization library http://libvirt.org
>
>


-- 
Clark J. Wang


reply via email to

[Prev in Thread] Current Thread [Next in Thread]