erlang/otp — pull request #535 by lemenkov (2014-11-08 13:06:42+00:00)
Title: Introduce os:getenv/2

I see a lot of projects are using os:getenv/1 in a following way:

Var = case os:getenv("EnvName") of false -> "DefaultVal" ; EnvVal -> EnvVal end.

For example:

* https://github.com/basho/bitcask/blob/f7cc709ca51c15df5f2418e961336163787c0ac4/src/bitcask_io.erl#L91
* https://github.com/basho/bitcask/blob/f7cc709ca51c15df5f2418e961336163787c0ac4/test/bitcask_pulse.erl#L407
* https://github.com/basho/bitcask/blob/f7cc709ca51c15df5f2418e961336163787c0ac4/test/bitcask_pulse.erl#L411
* https://github.com/processone/ejabberd/blob/7138cc56333ffd16eb4c0483b4b2421d12cb6977/src/ejabberd_config.erl#L90
* https://github.com/erlang/otp/blob/983a39ab079c9f825d31cfe349588a76824d8ef2/lib/inets/test/erl_make_certs.erl#L219
* https://github.com/erlang/otp/blob/983a39ab079c9f825d31cfe349588a76824d8ef2/lib/jinterface/test/jitu.erl#L120
* https://github.com/erlang/otp/blob/983a39ab079c9f825d31cfe349588a76824d8ef2/lib/ssh/src/ssh_connection.erl#L1304
* https://github.com/lemenkov/erlpmd/blob/cd6ef9ad793b4b8fe1ee61ba1baf2d7a8b08e872/src/erlpmd_ctl.erl#L30
* https://github.com/lemenkov/erlpmd/blob/cd6ef9ad793b4b8fe1ee61ba1baf2d7a8b08e872/src/erlpmd_ctl.erl#L35
* https://github.com/erlyvideo/flussonic-old/blob/e52617d21b7de9524ab64df6f8aa518ecd9527f3/apps/flussonic/src/flussonic.erl#L168
* https://github.com/jcomellas/getopt/blob/626698975e63866156159661d100785d65eab6f9/src/getopt.erl#L887

...and many more. So let's introduce a new function for that!