[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Arithmetic expansion in rediretion word is evaluated twice
From: |
Chet Ramey |
Subject: |
Re: Arithmetic expansion in rediretion word is evaluated twice |
Date: |
Tue, 2 Jun 2020 10:09:06 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 |
On 6/1/20 3:34 PM, Oğuz 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.
--
``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/