Skip to content

Instantly share code, notes, and snippets.

@s1113950
Created March 17, 2018 00:08
Show Gist options
  • Save s1113950/039b52c35337b377239bc1f7f37724c5 to your computer and use it in GitHub Desktop.
Save s1113950/039b52c35337b377239bc1f7f37724c5 to your computer and use it in GitHub Desktop.
Exports environment variables to root; useful in patching kubernetes deployment with ssh
#!/bin/bash
OLDIFS=$IFS
IFS=$'\n'
for each in `printenv`; do
echo "export "\'$each\' >> /root/.bashrc
done
IFS=$OLDIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment