It’s Cybersecurity Awareness Month! Join our interactive training session, or learn about security and AI from 1Password experts.
Forum Discussion
tjchambers
4 days agoNew Member
.env file comments preventing use of .env
I really want to like the local .env handling. However the header inserted in the .env file as a "warning comment" is interfering with my usage. If I regenerate the .env file from 1Password af...
- 4 days ago
Hey tjchambers,
Thanks for trying out the local .env feature and sharing your feedback!
You can get this working without removing the header by using a slightly different command:
set -a source .env set +aor
export $(grep -vE '^(#|$)' .env | xargs)Those should properly ignores comments in the file and load only the actual key-value pairs.
The issue you’re seeing happens because `export $(< .env)` assumes there are no comments or extra lines in the file, so it tries to export "1Password." as a variable name and errors out.
Does that help?
tjchambers
4 days agoNew Member
I can make that work. Thank you much for the suggestion.