News for hackers. Stuff that matters.
Re:Show HN: Dotenv, if it is a Unix utility by johnisgood on Monday April 29, 2024 @12:23PM (#40200416)
What about:

    source <(cat .env | xargs)
or:

    export $(cat .env | xargs)
And then:

    unset $(cat .env | cut -d= -f1)
?

The last one unsets the environment variables that were set by the first command, ensuring they are not persisted beyond the current shell session.

If you are worried about forgetting to execute it, there are a couple of ways to work around it, depending on your case.

There are no comments on this comment yet.