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


Groups > gnu.bash.bug > #16361 > unrolled thread

Re: Arithmetic expansion in rediretion word is evaluated twice

Started byChet Ramey <chet.ramey@case.edu>
First post2020-06-03 09:50 -0400
Last post2020-06-03 09:50 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Arithmetic expansion in rediretion word is evaluated twice Chet Ramey <chet.ramey@case.edu> - 2020-06-03 09:50 -0400

#16361 — Re: Arithmetic expansion in rediretion word is evaluated twice

FromChet Ramey <chet.ramey@case.edu>
Date2020-06-03 09:50 -0400
SubjectRe: Arithmetic expansion in rediretion word is evaluated twice
Message-ID<mailman.1056.1591192307.2541.bug-bash@gnu.org>
On 6/2/20 9:14 PM, Dale R. Worley wrote:
> 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?

It's clumsy. The code isn't really structured to make this easy. I'll put
it on the list to take a look at.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web