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: References: (chet.ramey@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: (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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <87sgfdeyrp.fsf@hobgoblin.ariadne.com> Xref: csiph.com gnu.bash.bug:16353 Chet Ramey 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