mirror of
https://github.com/jbranchaud/til
synced 2026-01-02 22:58:01 +00:00
Add Get The Value Of An Environment Variable as a clojure til.
This commit is contained in:
@@ -31,6 +31,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
||||
- [Aggregation Using merge-with](clojure/aggregation-using-merge-with.md)
|
||||
- [Evaluate One Liners With lein-exec](clojure/evaluate-one-liners-with-lein-exec.md)
|
||||
- [Expanding Macros](clojure/expanding-macros.md)
|
||||
- [Get The Value Of An Environment Variable](clojure/get-the-value-of-an-environment-variable.md)
|
||||
- [Open JavaDocs](clojure/open-javadocs.md)
|
||||
- [Pretty Print The Last Thing](clojure/pretty-print-the-last-thing.md)
|
||||
- [Quick Clojure Docs](clojure/quick-clojure-docs.md)
|
||||
|
||||
16
clojure/get-the-value-of-an-environment-variable.md
Normal file
16
clojure/get-the-value-of-an-environment-variable.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Get The Value Of An Environment Variable
|
||||
|
||||
You can get the value of an environment variable on your system using the
|
||||
`System/getenv` function. Just pass it the environment variable as a string:
|
||||
|
||||
```clojure
|
||||
> (System/getenv "HOME")
|
||||
"/Users/jbranchaud"
|
||||
```
|
||||
|
||||
It returns `nil` when the environment variable doesn't exist.
|
||||
|
||||
```clojure
|
||||
> (System/getenv "HOUSE")
|
||||
nil
|
||||
```
|
||||
Reference in New Issue
Block a user