Re: bash tab variable expansion question?

2011-02-24 Thread Eric Blake
On 02/24/2011 03:14 PM, Michael Kalisz wrote: > $ echo $PWD/ > will expand the $PWD variable to your current directory > > while in bash, version 4.2.0(1)-release: > > $ echo $PWD/ > will just escape the $ in front of the $ variable i.e: > > $ echo \$PWD/ > The shell-expand-line (Ctrl-Alt-e) wor

bash tab variable expansion question?

2011-02-24 Thread Michael Kalisz
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE

Re: Problem with how to assign an array

2011-02-24 Thread Steven W. Orr
Ok. Thanks for reading and responding. I thought I expressed myself but I see that I left too much out. I'll amplify below. On 2/24/2011 3:42 PM, Greg Wooledge wrote: On Thu, Feb 24, 2011 at 02:55:13PM -0500, Steven W. Orr wrote: I have three arrays a1=(aaa bbb ccc ddd) a2=(qqq www eee rrr)

Re: Problem with how to assign an array

2011-02-24 Thread Ken Irving
On Thu, Feb 24, 2011 at 03:42:57PM -0500, Greg Wooledge wrote: > On Thu, Feb 24, 2011 at 02:55:13PM -0500, Steven W. Orr wrote: > > I have three arrays > > > > a1=(aaa bbb ccc ddd) > > a2=(qqq www eee rrr) > > a3=(fff ggg hhh) > > > > I then set a_all > > > > a_all=("${a1[*]}" "${a2[*]}" "${a3[*

Re: Patch: Corrupt display for history search in vi-mode, 256-color prompt

2011-02-24 Thread Chet Ramey
On 2/22/11 8:15 PM, Micah Cowan wrote: > This bug affects both readline and bash (however, it is expected that > this bug is far more likely to affect bash than other typical > readline-using applications). It was experienced on bash 4.1-2ubuntu4 > (on Ubuntu 10.10, "Maverick Meercat"), but I check

Re: Problem with how to assign an array

2011-02-24 Thread Greg Wooledge
On Thu, Feb 24, 2011 at 02:55:13PM -0500, Steven W. Orr wrote: > I have three arrays > > a1=(aaa bbb ccc ddd) > a2=(qqq www eee rrr) > a3=(fff ggg hhh) > > I then set a_all > > a_all=("${a1[*]}" "${a2[*]}" "${a3[*]}" Missing ). Also, a far more serious problem, you used * when you should have

Problem with how to assign an array

2011-02-24 Thread Steven W. Orr
I know how to assign a simple array. My problem is a bit harder. I have three arrays a1=(aaa bbb ccc ddd) a2=(qqq www eee rrr) a3=(fff ggg hhh) I then set a_all a_all=("${a1[*]}" "${a2[*]}" "${a3[*]}" Later on, I decide which element of a_all I really want. So with my new index calculated, I

Re: Question. Autocomplete paths starting with %.

2011-02-24 Thread Clark J. Wang
On Thu, Feb 24, 2011 at 8:46 PM, d...@ucore.info wrote: > On Wed, Feb 23, 2011 at 5:06 AM, Clark J. Wang wrote: > > I can give you an example here: > > > > bash# vi compgen-example.sh > > _compgen_foo() > > { > > local cmd=$1 cur=$2 pre=$3 > > > > if [[ $cur = % ]]; then > > COMP

Re: Question. Autocomplete paths starting with %.

2011-02-24 Thread d...@ucore.info
On Wed, Feb 23, 2011 at 5:06 AM, Clark J. Wang wrote: > I can give you an example here: > > bash# vi compgen-example.sh > _compgen_foo() > { >     local cmd=$1 cur=$2 pre=$3 > >     if [[ $cur = % ]]; then >     COMPREPLY[0]='it-works' >     fi > } > > complete -F _compgen_foo foo > bash# sour