[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: Tue, 29 Dec 2009 14:28:37 -0800 (PST)

>    $as_echo "$as_me:${as_lineno-$LINENUM}: error: $1" >&$3

That is valid, if and only if $3 expands to an integer.

> > Which shells, and what is the text of the error?
> echo "foobar" >&$3

What is $3 during the time of your testing?  In isolation,
I can reproduce failures, but only when $3 is invalid.

> I haven't narrowed this down to a specific fault, but I suspect an error
> in the m4sh code. I think 
> Has anyone else seen this?

No.  That's because you are missing some context:

|  if test "$3"; then
|    as_lineno=${as_lineno-"$2"}
|    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
|  fi

Notice how the only way that we can encounter >&$3 is if $3
is non-empty.

> I could do with a modification here so that I don't get an >&$
> redirection structure. Can anyone advise on how to fix this within m4sh?

You'll have to demonstrate an instance of the bug in context, first.

Eric Blake

View this message in context:
Sent from the Gnu - Autoconf - General mailing list archive at

reply via email to

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