Last active
September 27, 2017 15:08
-
-
Save oinak/f24c176ac28fbf0b182684721de2e9ee to your computer and use it in GitHub Desktop.
Passing ENV vars from bash to ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# env_vars.rb | |
puts "A:#{ENV["AAA"]}" | |
puts "B:#{ENV["BBB"]}" | |
puts "C:#{ENV["CCC"]}" | |
puts "D:#{ENV["DDD"]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# env_vars.sh | |
AAA=1 | |
BBB=2 | |
export BBB | |
export CCC=3 | |
DDD="4" ruby env_vars.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./env_vars.sh | |
A: | |
B:2 | |
C:3 | |
D:4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment