Fedora dumps multiline string data directly onto stdout for env with plain LF's:
$ env
FEDORA_CHANGELOG=* Sun Feb 1 2026 Bob <bob@bobsautoparts.test>
- Prototype
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/.venv/bin
VERBOSE=1
...
There is probably no safe, distro independent way to safely parse data piped in from env. Because the value may itself begin a line with <VAR>=.
Frankly, requiring the user to pipe env in, is needlessly laborious. And breaks native Windows.
Fortunately, there is a safer, better UX way:
- Query an environment variable
JINJA_ENV.
- When
JINJA_ENV is present, then use the standard library to loop over environment variables and build up the data dictionary.
https://www.geeksforgeeks.org/python/python-os-getenv-method/
Fedora dumps multiline string data directly onto stdout for
envwith plain LF's:There is probably no safe, distro independent way to safely parse data piped in from
env. Because the value may itself begin a line with<VAR>=.Frankly, requiring the user to pipe
envin, is needlessly laborious. And breaks native Windows.Fortunately, there is a safer, better UX way:
JINJA_ENV.JINJA_ENVis present, then use the standard library to loop over environment variables and build up the data dictionary.https://www.geeksforgeeks.org/python/python-os-getenv-method/