Skip to content

Instantly share code, notes, and snippets.

@uabaluua
Created May 23, 2017 11:08
Show Gist options
  • Save uabaluua/c1db7bd9463ec917e0a2bafb9b4cd5bf to your computer and use it in GitHub Desktop.
Save uabaluua/c1db7bd9463ec917e0a2bafb9b4cd5bf to your computer and use it in GitHub Desktop.
Shell script set env vars
while read LINE; do
[ -z "$LINE" ] && continue
CONST=$(echo $LINE| cut -d'#' -f 1)
[ -z "$CONST" ] && continue
VAR=$(echo $CONST| cut -d'=' -f 1)
VALUE=$(echo $CONST| cut -d'=' -f 2)
echo "export $VAR=\"$VALUE\"" >> /etc/environment
done < .env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment