Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 bash 脚本的 heredoc 中运行一个 python 片段。我想将一个字符串从 python 变量传递给 shell。也许设置一个shell变量。我怎样才能做到这一点 ??
variable=$(python - <<EOS ... EOS )
python 脚本写入标准输出的任何内容都将存储在变量中。