[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Non-POSIX friendly output from declare -f / typeset -f
From: |
Chet Ramey |
Subject: |
Re: Non-POSIX friendly output from declare -f / typeset -f |
Date: |
Tue, 20 Jan 2015 10:58:56 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 1/20/15 9:09 AM, Raphael Cohn wrote:
> Hi,
>
> It seems with bash 4.3.30(1)-release (and probably others) that embedded
> functions are output with a leading 'function ' keyword when using declare
> -f / typeset -f. This is different to all other shells that support declare
> / typeset that I've tested (pdksh, mksh, Mac OS X ksh, which I think is AT&T)
There's no real compatibility here, since typeset isn't part of the Posix
standard. Most shells, including bash, are concerned primarily with being
able to parse their own output.
There will be a change in the next version of bash that omits the
`function' keyword in posix mode, but that doesn't really help you
if you have to use embedded function definitions now.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/