[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strange compgen behaviour
From: |
Chris F.A. Johnson |
Subject: |
Re: Strange compgen behaviour |
Date: |
Thu, 24 Sep 2009 11:07:06 -0400 (EDT) |
User-agent: |
Alpine 2.00 (LMD 1167 2008-08-23) |
On Thu, 24 Sep 2009, Bernd Eggink wrote:
> Chet Ramey schrieb:
> > > Hm, compgen appears to behave strange if words contain whitespace.
> >
> > Well, it splits the argument to -W on $IFS as documented. What other
> > strange behavior do you see?
>
> For example, this:
>
> function _aha
> {
> local list="a b:c d:e f"
> COMPREPLY=($(IFS=: compgen -W "$list"))
That expands to:
COMPREPLY=( a b c d e f )
> }
>
> complete -F _aha aha
>
> Typing aha <Tab> cycles through 6 items a, b, c, d, e, f, whereas I would
> expect 3 items 'a b', 'c d', 'e f'. It looks like compgen splits the argument
> to -W on $IFS _and_ whitespace. Or am I missing something?
--
Chris F.A. Johnson, webmaster <http://woodbine-gerrard.com>
===================================================================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
- Strange compgen behaviour, Mathias Dahl, 2009/09/23
- Re: Strange compgen behaviour, Bernd Eggink, 2009/09/23
- Message not available
- Re: Strange compgen behaviour, Mathias Dahl, 2009/09/23
- Re: Strange compgen behaviour, Bernd Eggink, 2009/09/24
- Re: Strange compgen behaviour, Chet Ramey, 2009/09/24
- Re: Strange compgen behaviour, Bernd Eggink, 2009/09/24
- Re: Strange compgen behaviour, Chet Ramey, 2009/09/24
- Re: Strange compgen behaviour,
Chris F.A. Johnson <=
- Re: Strange compgen behaviour, Chet Ramey, 2009/09/25
- Re: Strange compgen behaviour, Bernd.Eggink, 2009/09/25
- Message not available
- Re: Strange compgen behaviour, Mathias Dahl, 2009/09/24
- Re: Strange compgen behaviour, Mathias Dahl, 2009/09/24
- Re: Strange compgen behaviour, Greg Wooledge, 2009/09/25
- Message not available
- Re: Strange compgen behaviour, Mathias Dahl, 2009/09/25
- Re: Strange compgen behaviour, Mathias Dahl, 2009/09/25
- Re: Strange compgen behaviour, Andreas Schwab, 2009/09/25
- Message not available
- Re: Strange compgen behaviour, Mathias Dahl, 2009/09/25
- Re: Strange compgen behaviour, Bernd Eggink, 2009/09/25