On Wed, 24 Sep 2014 21:35:19 -0400, 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.
>
> > 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.
I'm not arguing about anything, I just have a question. I understand that
with the current method used to export functions, it is not possible to
export a variable to a child whose value begins exactly with the characters
in question. A quick test seems to confirm that:
$ x='() { echo a; }' bash -c 'echo "$x"'
$ x='() { echo a; }' bash -c 'echo "$x"'
() { echo a; }
So is there a way to be able to export variables with arbitrary values,
including '() {' ? Sorry if this has been discussed before.
Thanks
--
D.