Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16353

Re: Arithmetic expansion in rediretion word is evaluated twice

Path csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From worley@alum.mit.edu (Dale R. Worley)
Newsgroups gnu.bash.bug
Subject Re: Arithmetic expansion in rediretion word is evaluated twice
Date Tue, 02 Jun 2020 21:14:34 -0400
Lines 18
Approved bug-bash@gnu.org
Message-ID <mailman.1026.1591146888.2541.bug-bash@gnu.org> (permalink)
References <e77206bd-282c-1b99-d733-1fdd26289e9c@case.edu> <87sgfdeyrp.fsf@hobgoblin.ariadne.com>
NNTP-Posting-Host lists.gnu.org
X-Trace usenet.stanford.edu 1591146888 795 209.51.188.17 (3 Jun 2020 01:14:48 GMT)
X-Complaints-To action@cs.stanford.edu
Cc oguzismailuysal@gmail.com, bug-bash@gnu.org, chet.ramey@case.edu
To chet.ramey@case.edu
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcastmailservice.net; s=20180828_2048; t=1591146876; bh=I8IvnNSG2Lf3JmMpcWGUDDe0DRSukQq28d9BgmgS+MA=; h=Received:Received:Received:Received:From:To:Subject:Date: Message-ID; b=TfzLxIftKasV5RPX941GHHkGvI8SCUAhDJpNOsv7meBfU/06xtCrCln9dVAYBRoVT wlS11vhkX2FGlft3Bk7rvQsPh9TgvjkgFRxSqnA6vm99vtZTl2QuxkW5sTiJ6LgTU3 CETjNmGNkMaGVy3I1H7N5XoGuFCETUKMHfS9Zcpj1zafzvvUCq80NCIuhV21adFcZs xDsZpXy+xqeAkWt8JoUfDr00m3KrRSxwG5JJoDqkw5U7bnWSysc6RSb+fj3dk2yd5/ Y3ESP2PM5ImuF3/oYX6Ej1sZcp/C38CUjlEHGpcoyulqtOsD+kU4rkfhelA9JaYBaB eLGEeeOldcYZw==
X-Xfinity-VMeta sc=0.00;st=legit
X-Authentication-Warning hobgoblin.ariadne.com: worley set sender to worley@alum.mit.edu using -f
In-Reply-To <e77206bd-282c-1b99-d733-1fdd26289e9c@case.edu> (chet.ramey@case.edu)
Received-SPF permerror client-ip=2001:558:fe21:29:69:252:207:41; envelope-from=worley@alum.mit.edu; helo=resqmta-ch2-09v.sys.comcast.net
X-detected-operating-system by eggs.gnu.org: First seen = 2020/06/02 21:14:36
X-ACL-Warn Detected OS = ???
X-Spam_score_int -18
X-Spam_score -1.9
X-Spam_bar -
X-Spam_report (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN
X-Spam_action no action
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <87sgfdeyrp.fsf@hobgoblin.ariadne.com>
Xref csiph.com gnu.bash.bug:16353

Show key headers only | View raw


Chet Ramey <chet.ramey@case.edu> writes:
> On 6/1/20 3:34 PM, Oguz wrote:
>> See:
>> 
>>     $ unset foo
>>     $ : <$((foo+=42))
>>     bash: 84: No such file or directory
>>     $ echo $foo
>>     84
>
> Yes. The redirection is evaluated once for the open and again for the
> error message.

That does seem rather a bug, or at least, a poor error message.  Is it
hard to save the string that was attempted to be opened?

Dale

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: Arithmetic expansion in rediretion word is evaluated twice worley@alum.mit.edu (Dale R. Worley) - 2020-06-02 21:14 -0400

csiph-web