There is a rise of .env
files (nodejs community & even Python one).
They look like:
var1=val1
var2="val2 referencing ${var1}"
While there is special handling for export
prefix I wonder if it is possible to process .env
file by Bash so it exports all definitions without file containing export
keyword...
I can imaging rudimentary form (without proper handling of edge cases):
while read line; do
case "$line" in
"export "*=*) eval "$line";;
*=*) eval "export $line";;
esac
done <.env