Replies: 1 comment
-
|
I also tested |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Good day,
I noticed dotenv parses escaped characters differently from the way bash does. I have a variable that contains a backtick, this .env file is used by a bash script and then by node with dotenv.
Bash needs the backtick to be escaped with a backslash but dotenv doesn't, so the variable contains the
\. Without the backslash bash fails with: unexpected EOF while looking for matching `I was wondering if this is expected behavior or does dotenv try to match the way shell scripts work and therefore this is a bug? I wanted to bring this up here before creating an issue.
Here's an example:
I found a related issue: #468, but in that case adding the backslash was outputting double slash: test\\`
I know this kind of change could potentially break existing code, so I wonder if it would be better to put it behind some configuration option, maybe something like
{posixCompat: true}For now my solution is to remove the backslash after reading the variable.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions