Skip to content

Instantly share code, notes, and snippets.

@pandres95
Last active February 6, 2017 12:55
Show Gist options
  • Save pandres95/73a3e5a88cab9a5630aa9b4376ed8d38 to your computer and use it in GitHub Desktop.
Save pandres95/73a3e5a88cab9a5630aa9b4376ed8d38 to your computer and use it in GitHub Desktop.
Read environment variables from process
process | {
while IFS= read -r line
do
set -f
array=(${line//:/ })
export ${array[0]}=${array[1]}
done
}
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