Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

linux source env file

# To ignore lines that start with #, use this (thanks to Pete's comment):
export $(grep -v '^#' .env | xargs)

# And if you want to unset all of the variables defined in the file, use this:
unset $(grep -v '^#' .env | sed -E 's/(.*)=.*/1/' | xargs)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #linux #source #env #file
ADD COMMENT
Topic
Name
6+4 =