Skip to content

Instantly share code, notes, and snippets.

@EricLondon
Created April 8, 2022 19:23
Show Gist options
  • Save EricLondon/84585e1a7be2fd0697964e0ad10bcda5 to your computer and use it in GitHub Desktop.
Save EricLondon/84585e1a7be2fd0697964e0ad10bcda5 to your computer and use it in GitHub Desktop.
set environment variable outside script
#!/bin/sh
# Usage:
# . ./setenv.sh
#
# echo $ENV1
# blah1
#
# echo $ENV2
# blah2
#
# env | egrep ENV
# ENV1=blah1
# ENV2=blah2
export ENV1="blah1"
declare -x "ENV2"="blah2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment