[Top][All Lists]

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

Re: Redirecting to a stream number held in a variable

From: Eric Blake
Subject: Re: Redirecting to a stream number held in a variable
Date: Wed, 30 Dec 2009 18:38:04 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090812 Thunderbird/ Mnenhy/

Hash: SHA1

According to Mark Hobley on 12/30/2009 2:56 PM:
> --- On Tue, 29/12/09, Eric Blake <address@hidden> wrote:
>> From: Eric Blake <address@hidden>
>> Subject: Re: Redirecting to a stream number held in a variable
>> You'll have to demonstrate an instance of the bug in
>> context, first.
> Here is what I have so far:
> In an empty directory create a file as follows:

So far, so good.  I see no error in your sample file nor in the generated
output.  Does this actually cause an error in your shell?  If so, PASTE
the actual transcript showing the error happening.

> Modify the script to populate $3 with a value of 5 and call as_fn_error()

That's pretty vague.  What _exactly_ did you do to trigger an error, and
on which shell?

> An error will occur as a result of the >&$3 syntax being used.

Not in the default you posted, at least not on any of the
POSIX-compliant (and even not-so-compliant) shells that I have access to.
 You aren't making a very good argument for this being a bug.

>   *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;

Yes, that is valid shell code, and sets things up so that inside
as_fn_error, $3 will contain 5.  But 5 is an integer, so there is no problem.

> I think that the shells are tripping up on the >&$3 syntax **before** the
> substitution to a value is being made.

No.  Variable expansion inside of shell functions occurs when the function
is called, not when it is first parsed.  It doesn't matter what $3 is when
as_fn_error is defined, only what the third argument is when it is called.
 You still haven't proven that there is anything ever calling the function
with an invalid third argument.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


reply via email to

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