🖥
export ENV by reading dotenv file by Shell command ( set -a; source .e
Command
set -a; source .env; set +a;
Example
echo "EXAMPLE1=ABC\nEXAMPLE2=DEF" >> .env
cat .env
EXAMPLE1=ABC
EXAMPLE2=DEF
env | grep EXAMPLE
set -a; source .env; set +a;
env | grep EXAMPLE
EXAMPLE1=ABC
EXAMPLE2=DEF
Ref
NAME
set - Set or unset values of shell options and positional parameters.
SYNOPSIS
set [--abefhkmnptuvxBCHP] [-o option-name] [arg ...]
DESCRIPTION
Set or unset values of shell options and positional parameters.
Change the value of shell attributes and positional parameters, or
display the names and values of shell variables.
Options:
-a Mark variables which are modified or created for export.
Original by Github issue
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。
公開日時
2020-03-03
Discussion