[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: errortracing inside || and eval
From: |
Chet Ramey |
Subject: |
Re: errortracing inside || and eval |
Date: |
Wed, 30 Nov 2022 11:18:06 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 |
On 11/30/22 8:56 AM, Tycho Kirchner wrote:
Hi!
We would like to run an error trap inside a function, even if it is called
within || -> func || true.
While bash's manpage documents in the trap-section that no error trap runs
"if the failed command ... is part of a command executed in ||", we found
the following workaround, using "eval":
This is a bug in eval.
--
``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/