Skip to content

$ sign in env vars don't get recognized #94

Description

@dormant-user

Problem
When there is a $ in a .env file, the var doesn't get loaded

Minimum reproducible code

echo 'dollar="Dollar$ign"' > .env
use std::fs;

fn main() {
    let _ = dotenv::from_path(".env");
    let dollar = std::env::var("dollar").unwrap_or_default();
    println!("Resolved: {}", dollar);
    let env_content = fs::read_to_string(".env").unwrap_or_default();
    println!("File content: {}", env_content)
}

Expected Output

Resolved: Dollar$ign
File content: dollar="Dollar$ign"

Actual Output

Resolved: 
File content: dollar="Dollar$ign"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions