0
根据systemd-run文档,-setenv
选项可用于“使用指定的环境变量集运行服务进程”。systemd-run在使用时未设置环境变量--setenv
然而,这似乎是环境变量其实是不可用的过程:
# systemd-run -t --setenv=TEST=Success echo TEST:$TEST
Running as unit run-20705.service.
Press ^] three times within 1s to disconnect TTY.
TEST:
我误解了--setenv
期权的使用情况如何?运行systemd版本219.
嘿 - 不能相信我错过了。谢谢 – AlexBrand
使用'set -x'可以帮助调试bash – Robo