bug-bash
[Top][All Lists]
Advanced

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

Re: Issues with exported functions


From: Greg Wooledge
Subject: Re: Issues with exported functions
Date: Wed, 24 Sep 2014 15:53:10 -0400
User-agent: Mutt/1.4.2.3i

On Thu, Sep 25, 2014 at 03:44:23AM +0800, lolilolicon wrote:
> Otherwise, if this feature is going to stay (can anyone enlighten me why
> it's useful?), please document it explicitly.

First, it is documented:

      Functions may be exported so that subshells automatically have them
      defined with the -f option to the export builtin.

(Good luck finding that if you didn't know to look for it, though.)

Second, it's "useful" in niche cases like this:

  foo() { ...; }
  export -f foo
  find . -type f -exec bash -c 'for f; do foo "$f"; done' _ {} +

So, if Chet removes the feature, it would probably break something that
someone cares about.  Maybe there could be a compile-time option to
disable it.  Maybe there already is -- I didn't look.



reply via email to

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