🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #566

exportable functions

#566
From: Brian Fox
Date: Fri, 08 Sep 1989 16:21
25 lines
1231 bytes
   From: tmb@ai.mit.edu (Thomas M. Breuel)
   Date: Fri, 8 Sep 89 04:54:05 EDT

   It would be nice if Bash supported exportable functions like V9 "sh".
   Strings of the form "name=value" in the environment are considered
   environment variables, and strings of the form "name(){value}" are
   considered environment functions.

Bash 1.03 can export functions to other bashes.

Upon reading in the environment, if a string of the form "name=() {" is
found, then that is a function definition.  Perhaps I can support the
other syntax as well.

toplevel$ foo () { echo bar }
toplevel$ export foo
toplevel$ printenv foo
foo=() { echo bar }
toplevel$ bash
bash$ type foo
foo is a function
foo () { echo bar }

Brian Fox
Technical Details
Message-ID: <8909081621.AA09286@aurel.caltech.edu>
Path: arc1-ca.pugleaf.net!utzoo!yunexus!telly!philmtl!uunet!tut.cis.ohio-state.edu!aurel.caltech.edu!bfox
References: <8909080854.AA12325@rice-chex>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!yunexus!telly!philmtl!uunet!tut.cis.ohio-state.edu!aurel.caltech.edu!bfox
From: bfox@aurel.caltech.edu (Brian Fox)
Newsgroups: gnu.bash.bug
Subject: exportable functions
Message-ID: <8909081621.AA09286@aurel.caltech.edu>
Date: 8 Sep 89 16:21:24 GMT
Article-I.D.: aurel.8909081621.AA09286
References: <8909080854.AA12325@rice-chex>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: bfox@aurel.caltech.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 25