autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] Yet another shell function prerequisite!


From: Eric Blake
Subject: Re: [PATCH] Yet another shell function prerequisite!
Date: Tue, 14 Oct 2008 17:00:33 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Paolo Bonzini <bonzini <at> gnu.org> writes:

> 
> 
> > In the meanwhile I thought about
> > 
> >   as_lineno=${as_lineno-$LINENO} func
> > 
> > which is a slick trick, as it supports nesting and does not require
> > unset.  
> 
> ... and fails in bash 2.x, of course.

How?  I built 2.05a just for this occasion, and I couldn't reproduce a failure.

$ func_var(){ var=$var${a-B}; }
$ func_var
$ a=b func_var
$ func_var
$ b=c      
$ a=${a-$b} func_var
$ func_var
$ echo $var
BbBcB
$ echo $BASH_VERSION
2.05a.0(1)-release

-- 
Eric Blake








reply via email to

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