Skip to content

Instantly share code, notes, and snippets.

@jtattermusch
Last active February 17, 2016 17:59
Show Gist options
  • Save jtattermusch/5c078dafb68e7fb64627 to your computer and use it in GitHub Desktop.
Save jtattermusch/5c078dafb68e7fb64627 to your computer and use it in GitHub Desktop.
# based on http://www.smithii.com/node/44
# ensure correct loading of env vars
pushd . >/dev/null
for __dir in \
/proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Session\ Manager/Environment \
/proc/registry/HKEY_CURRENT_USER/Environment
do
cd "$__dir"
for __var in *
do
__var=`echo $__var | tr '[a-z]' '[A-Z]'`
test -z "${!__var}" && export $__var="`cat $__var`" >/dev/null 2>&1
done
done
unset __dir
unset __var
popd >/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment