Re: bash-completion between do and done

2011-11-05 Thread Chris F.A. Johnson

On Sat, 5 Nov 2011, Bob Proulx wrote:


Peng Yu wrote:

Current, bash doesn't do command completion between do and done (for loop).
I'm wondering if this feature can be added.


Of course bash does do command completion between do and done.  Can
you give an exact example test case?  On what version of bash?


   I can confirm it on 3.05b, 3.0 and 4.2:

while [ ${n:=0} -lt 5 ]
do
  se

  All I get is a beep.

--
   Chris F.A. Johnson, 
   Author:
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)



Re: bash-completion between do and done

2011-11-05 Thread Bob Proulx
Chris F.A. Johnson wrote:
>I can confirm it on 3.05b, 3.0 and 4.2:
>
> while [ ${n:=0} -lt 5 ]
> do
>   se
>
>   All I get is a beep.

Hmm...  It is still completing.  But not command completion.  It is
doing filename completion instead of command completion.  It is out of
sync with the current action point.

Of course I was trying filename completion.  The simpler case is:

  while false; do l

But other completions do work fine.

  while false; do ls --so
  while false; do ls ~/.ba

As a workaround you can force command completion using 'C-x !' and
'M-!'.

Bob



Re: {varname} for redirection does not work with arrays

2011-11-05 Thread Stephane CHAZELAS
2011-11-2, 12:01(-06), unkn...@vmw-les.eng.vmware.com:
[...]
> Description:
>   If {varname} is an assoc. array in a redirection the exec will fail
>   The [] should not be confused with pathname expansion just like ${}.
>
> Repeat-By:
>   $ declare -A array
>   $ exec {array[key]}