[Top][All Lists]
[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
- [PATCH] Yet another shell function prerequisite!, Paolo Bonzini, 2008/10/13
- Re: [PATCH] Yet another shell function prerequisite!, Eric Blake, 2008/10/13
- Re: [PATCH] Yet another shell function prerequisite!, Eric Blake, 2008/10/13
- Re: [PATCH] Yet another shell function prerequisite!, Paolo Bonzini, 2008/10/13
- Re: [PATCH] Yet another shell function prerequisite!, Paolo Bonzini, 2008/10/13
- Re: [PATCH] Yet another shell function prerequisite!, Ralf Wildenhues, 2008/10/13
- Re: [PATCH] Yet another shell function prerequisite!, Paolo Bonzini, 2008/10/14
- Re: [PATCH] Yet another shell function prerequisite!, Paolo Bonzini, 2008/10/14
- Re: [PATCH] Yet another shell function prerequisite!,
Eric Blake <=
- Re: [PATCH] Yet another shell function prerequisite!, Eric Blake, 2008/10/14
- Re: [PATCH] Yet another shell function prerequisite!, Eric Blake, 2008/10/14