Re: Passing variables by reference conflicts with local

2010-05-03 Thread Greg Wooledge
On Sat, May 01, 2010 at 04:26:16AM -0500, Dennis Williamson wrote: > I prefer to avoid using eval by using declare, but declare inside a > function makes the variable local. Wouldn't it be nice to have a > global flag (declare -g) like zsh's typeset -g. Yeah. It definitely would. (This comes up

Re: Passing variables by reference conflicts with local

2010-05-03 Thread Chet Ramey
On 5/3/10 8:21 AM, Greg Wooledge wrote: > On Sat, May 01, 2010 at 04:26:16AM -0500, Dennis Williamson wrote: >> I prefer to avoid using eval by using declare, but declare inside a >> function makes the variable local. Wouldn't it be nice to have a >> global flag (declare -g) like zsh's typeset -g.

possible bug with 4.1

2010-05-03 Thread George R Goffe
Howdy, I have noticed that some commands appear in history and some do not. I have isolated that to commands that have blanks before their name. I sometimes see this with pasted commands but this may be the same problem. Am I doing something wrong by any chance? Regards, George... "It's not

Re: possible bug with 4.1

2010-05-03 Thread Bob Proulx
George R Goffe wrote: > I have noticed that some commands appear in history and some do > not. I have isolated that to commands that have blanks before their > name. I sometimes see this with pasted commands but this may be the > same problem. > > Am I doing something wrong by any chance? This is

Problem around brackets, && and ||

2010-05-03 Thread Kunszt Árpád
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: x86_64-pc-linux-gnu-gcc Compilation CFLAGS: -DPROG

Re: Problem around brackets, && and ||

2010-05-03 Thread Greg Wooledge
On Mon, May 03, 2010 at 07:49:12PM +0200, Kunszt Árpád wrote: > Description: > If the last command in a {...} has && and fails and the {...} > has an || outside then the outside command will be executed. Use if/then/else/fi instead of && ||. Using && || is dangerous, as I've explained her

Re: Passing variables by reference conflicts with local

2010-05-03 Thread Freddy Vulto
On 100503 08:57, Chet Ramey wrote: > > On Sat, May 01, 2010 at 04:26:16AM -0500, Dennis Williamson wrote: > >> I prefer to avoid using eval by using declare, but declare inside a > >> function makes the variable local. Wouldn't it be nice to have a > >> global flag (declare -g) like zsh's typeset -

Re: Problem around brackets, && and ||

2010-05-03 Thread Kunszt Árpád
2010-05-03 21:25 keltezéssel, Greg Wooledge írta: > On Mon, May 03, 2010 at 07:49:12PM +0200, Kunszt Árpád wrote: > >> Description: >> If the last command in a {...} has && and fails and the {...} >> has an || outside then the outside command will be executed. >> > Use if/then/else/

Re: Passing variables by reference conflicts with local

2010-05-03 Thread Freddy Vulto
I think I found a much cleaner workaround. It looks like a called function can really unset local variables in the caller(?!), so that passing by reference works: _blackbox_unset_vars "$2" "$3" If you would try to unset local variables directly in "blackbox()", using: unset -v "$2" "$3"

Re: Passing variables by reference conflicts with local

2010-05-03 Thread Matthew Woehlke
Freddy Vulto wrote: # Param: $1 �variable name to return value to # Public library function blackbox() { local __1 _blackbox __1 [[ $1 == __1 ]]&& echo "ERROR: variable name conflicts"\ "with local variable: $1" printf -v $1 %s

Re: completion gobbles partial match string

2010-05-03 Thread Chet Ramey
On 5/1/10 8:46 PM, jida...@jidanni.org wrote: > set show-all-if-ambiguous on This is the problem. I'll take a look. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.c

Re: completion gobbles partial match string

2010-05-03 Thread Chet Ramey
On 5/3/10 9:23 PM, Chet Ramey wrote: > On 5/1/10 8:46 PM, jida...@jidanni.org wrote: > >> set show-all-if-ambiguous on > > This is the problem. I'll take a look. This is an interesting issue. The problem is as I described: globbing can result in multiple matches without any common prefix, whic