Last active
February 6, 2017 12:55
-
-
Save pandres95/73a3e5a88cab9a5630aa9b4376ed8d38 to your computer and use it in GitHub Desktop.
Read environment variables from process
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
process | { | |
while IFS= read -r line | |
do | |
set -f | |
array=(${line//:/ }) | |
export ${array[0]}=${array[1]} | |
done | |
} |
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
process | { | |
while IFS= read -r line | |
do | |
set -f | |
array=("${(@s/:/)line}") | |
export $array[1]=$array[2] | |
lastline="$line" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment