Re: "environment:" instead of $0 in front of fatal errors from functions
From:
Chet Ramey
Subject:
Re: "environment:" instead of $0 in front of fatal errors from functions
Date:
Thu, 25 May 2023 15:47:12 -0400
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 5/22/23 8:36 AM, Emanuele Torre wrote:
Error messages for fatal error e.g. ${x?foo} or rovar=foo or
$x expanded with nounset, report an error message prefixed by the string
"environment:" instead of "scriptname:" (or "$0:").
Thanks for the report. Error messages during function execution display the
source file where the function is defined. When there's no source file,
such as -c command or when reading a script from stdin, the shell defaults.
We can do a little better job of defaulting here.
--
``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/