emacs – 如何捕获elisp中shell命令的标准输出?
发布时间:2020-12-15 20:01:21 所属栏目:安全 来源:网络整理
导读:我想在Emacs中运行一个shell命令,并捕获到一个变量的完整输出。有没有办法做到这一点?例如,我想能够以以下方式将hello-string设置为“hello”: (setq hello-string (capture-stdout-of-shell-command "/bin/echo hello")) 函数capture-stdout-of-shell-c
我想在Emacs中运行一个shell命令,并捕获到一个变量的完整输出。有没有办法做到这一点?例如,我想能够以以下方式将hello-string设置为“hello”:
(setq hello-string (capture-stdout-of-shell-command "/bin/echo hello")) 函数capture-stdout-of-shell-command是否存在,如果存在,它的真实名称是什么?
shell-command-to-string是否满足你的目的?
例如: (shell-command-to-string "/bin/echo hello") 希望这可以帮助。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |