bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `declare -f' does not output the "function" keyword when required


From: Chet Ramey
Subject: Re: `declare -f' does not output the "function" keyword when required
Date: Mon, 5 Dec 2022 09:23:32 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

On 12/3/22 6:05 AM, Emanuele Torre wrote:
In Bash, it is possible to define functions that look like assignment
words using the function keyword:

     function a=2 { printf hi\\n ;}

When `declare -f' is used to output all the function definitions, bash
will not output that function definition with the "function" keyword,
generating invalid code:

Thanks for the report.

--
``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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]