shdotenv
shdotenv copied to clipboard
shdotenv seems to ignore -e /dev/null
Unless I understood the docs wrong, shdotenv export
ignores -e /dev/null
Ex:
$ echo "VAR1=foo" > .env
$ shdotenv -e /dev/null -e .env export
HOME='/root'
PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
PWD='/tmp'
SHLVL='2'
TERM='xterm'
VAR1='foo'
Expected behavior
$ echo "VAR1=foo" > .env
$ shdotenv -e /dev/null -e .env export
VAR1='foo'
Environment:
- OS: linux (alpine:3.17 container)
- awk version: GNU awk 5.1.1
Additional context I would like to use shdotenv to manipulate an env file ensuring that file is valid and merging files, for example:
echo "VAR1=foo" > .existing.env
MYOUTPUT=$(echo 'value that I have no idea on how to escape')
shdotenv export MYOUTPUT | shdotenv -e /dev/null -e existing.env -e - export
Of course I can do shdotenv export MYOUTPUT >> existing.env
and rely that values would be overwritten due their order, but I would prefer to use shdotenv to keep the env file cleaner.