Bug 1525593
Summary: | show variables containing spaces in 'systemctl show -p Environment' | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Pavel Raiskup <praiskup> |
Component: | systemd | Assignee: | systemd-maint |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | lnykryn, msekleta, s, systemd-maint, zbyszek |
Target Milestone: | --- | Keywords: | FutureFeature |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | systemd-246~rc1-1.fc33 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-07-09 08:50:08 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Pavel Raiskup
2017-12-13 16:05:52 UTC
Looks like upstream systemd uses escaping in this case. [root@notas ~]# systemctl show -p Environment cups.service Environment=PGDATA=/var/lib/pgsql/da\x20ta Good, thanks - just for reference - could we link the upstream implementation (the escaping) from here? I'd like to ensure that something like this works: #! /bin/bash systemd_output=$(systemctl show -p Environment "$1") set -- ${systemd_output##Environment=} for item; do name=${item%%=*} value=$(echo -e "${item##*=}") eval "$name=\$value" done I guess you want to call systemd-escape --unescape on the string. Thanks, nice to know :-) but I guess I still need to split the environment variables, somehow. Upstream used to do that, but it doesn't anymore :( https://github.com/systemd/systemd/commit/5993d46a1a Built in rawhide. |