On Thu, Sep 25, 2014 at 9:35 AM, Chet Ramey <[email protected]> wrote:
> On 9/24/14, 3:44 PM, lolilolicon wrote:
>
>> Personally, I have never needed this feature. I would vote for its
>> removal: It's very surprising, creates bugs, and is not very useful.
>
> There are more things in heaven and earth that are dreamt of in your
> philosophy.
OK guys! Exported functions are widely used by experts, I get it now.
>
>> Otherwise, if this feature is going to stay (can anyone enlighten me why
>> it's useful?), please document it explicitly.
>
> Function export is documented. The exact mechanism need not be.
Sure, the mechanism need not be documented, if it didn't matter on the
interface level. But it does. In particular,
% pat='() { $:*;}' bash -c 'tr "$pat" _ <<< "(x){1}"'
(x){1}
(This is bash 4.3.25)
This is not the best example, but you get the idea.
Perhaps you have plans to change the implementation?