Programming-Idioms

History of Idiom 205

Idiom #205 Get an environment variable

Read an environment variable with the name "FOO" and assign it to the string variable foo. If it does not exist or if the system does not support environment variables, assign a value of "none".

#Edit dateEdit SummaryAuthor
👁 Δ 28 2020-07-12, 00:25 New Elixir implementation by user [quorauk] quorauk
👁 Δ 27 2020-06-10, 04:32 New JS implementation by user [cfbender] cfbender
👁 Δ 26 2020-06-08, 22:10 [Rust] Now assigns to var foo, instead of printing programming-idioms.org
👁 Δ 25 2020-05-22, 10:14 New C++ implementation by user [nuraby] nuraby
👁 Δ 24 2019-10-19, 23:07 New Rust implementation by user [Yann] Yann
👁 Δ 23 2019-10-07, 20:09 [Csharp] Wrong variable name bigwavedave
👁 Δ 22 2019-10-07, 20:06 New Csharp implementation by user [bigwavedave] bigwavedave
👁 Δ 21 2019-10-02, 07:23 New Erlang implementation by user [nopeslide] nopeslide
👁 Δ 20 2019-10-01, 08:39 New Go implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 19 2019-10-01, 08:34 [Go] Avoid underscores in snippets programming-idioms.org
👁 Δ 18 2019-10-01, 08:33 [VB] Avoid underscores in snippets programming-idioms.org
👁 Δ 17 2019-10-01, 08:33 [Python] Avoid underscores in snippets programming-idioms.org
👁 Δ 16 2019-10-01, 08:32 [Python] Avoid underscores in snippets programming-idioms.org
👁 Δ 15 2019-09-30, 19:09 [VB] custom var called foo not a built in var called foo silver-dragon
👁 Δ 14 2019-09-30, 19:07 New VB implementation by user [silver-dragon] silver-dragon
👁 Δ 13 2019-09-30, 15:46 New Python implementation by user [richiverse] richiverse
👁 Δ 12 2019-09-30, 12:00 New Python implementation by user [Pantelwolf] Pantelwolf
👁 Δ 11 2019-09-29, 22:41 New Ruby implementation by user [steenslag] steenslag
👁 Δ 10 2019-09-29, 21:01 New Pascal implementation by user [Bart] Bart
👁 Δ 9 2019-09-29, 20:59 [C] Hmm, assigning "none" does not make much sense phrank
👁 Δ 8 2019-09-29, 20:58 New C implementation by user [phrank] phrank
👁 Δ 7 2019-09-29, 19:52 New Go implementation by user [j] j
👁 Δ 6 2019-09-29, 19:13 [Perl] Avoid comments in imports and snippets programming-idioms.org
👁 Δ 5 2019-09-29, 19:12 [Perl] Apply name change env -> foo programming-idioms.org
👁 Δ 4 2019-09-29, 19:11 [Fortran] Apply name change env -> foo programming-idioms.org
👁 Δ 3 2019-09-29, 19:10 Less confusing IMO if we name the result variable foo programming-idioms.org
👁 Δ 2 2019-09-29, 17:15 New Perl implementation by user [daxim] daxim
1 2019-09-29, 17:07 Idiom creation by user [tkoenig] tkoenig