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

Exported (ba)sh functions in the environment



Hi there.

I recently had cause to search for an environment variable to see if it was being set. As a result I noticed that the environment has become a bit of a dumping ground for installed programs where configuration files would have been a cleaner option.

Looking for an override in the environment is of course a good idea, but setting
default values in the environment that could be

1. hard coded in the programs as defaults
2. stored in a configuration file
3. sourced from a configuration script

is a bit sloppy.

On my machine running "set > set.txt && ls -lsa set.txt" reveals that my
environment contains 225517 of "stuff" - some of it is even being taken up by
exported function definitions!

That's 225517 bytes that needs to be copied every time a script runs.

Regards,
Philip Ashmore


Reply to: