没有任何 systemd 命令在 WSL(Ubuntu Bash 18.04)中工作。当我跑时sudo systemctl is-active kubelet,错误是
output: System has not been booted with systemd as init system (PID 1). Can't operate.
: running command: sudo systemctl is-active kubelet
如何在 WSL 中启用 systemd 功能?有什么办法摆脱System has not been booted with systemd
我想动态生成环境变量名称并将值设置为该变量。我写了一个shell脚本如下。
temp="$(date +%s)"
echo $temp
export ${temp} = "Test value"
echo "Pass variable ${temp}"
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,生成的时间戳应该是键,“测试值”是该键的值。此键和值必须导出到会话。
如何使用 shell 脚本实现这一点?