shell - 来自 Emacs 的外部进程调用期间的临时修改环境

标签 shell emacs environment-variables temporary convenience-methods

有没有方便功能(with-...-like)临时修改方式使用 shell-comandstart-process 时的环境变量?

提前致谢, 每

最佳答案

过程环境是一个 要继承的子进程的覆盖环境变量列表。

(let ((process-environment (cons "FOO=BAR" process-environment)))
  (shell-command-to-string "echo $FOO"))

->

BAR

关于shell - 来自 Emacs 的外部进程调用期间的临时修改环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6483875/

相关文章:

windows - 如何在 Windows git bash shell 中访问此环境变量

mysql - 从 Java 和 Shell 运行 cmd 时在 Mysqldump 中添加日期

linux - Bash 脚本第 106 行 : syntax error: unexpected end of file

linux - 为什么 unix while read 不读取最后一行?

java - Eclipse IDE 中的 Emacs 键绑定(bind)

python - 使用 Python 设置 cx_Oracle 环境变量

bash - 循环(?)一个 if 语句

Emacs 自动完成 : don't trigger on RET in inline suggestion

r - Emacs+ESS+R : How to have help page open in new buffer

node.js - 如果我正在开发或生产中,如何告诉 firebase? (对于 firebase 函数沙箱/实时开关)