在组织模式下捕获带有babel的shell命令的输出 [英] Capture output from a shell command with babel in org-mode

查看:135
本文介绍了在组织模式下捕获带有babel的shell命令的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解我的网络硬件。

I want to know about my networking hardware.

lspci | grep -i net

从终端,此命令提供以下输出:

From the terminal, this command gives the following output:



00:19.0以太网控制器:Intel Corporation 82577LM千兆网络连接(rev 06)
02:00.0网络控制器:Intel公司Centrino Advanced-N 6200(rev 35)

00:19.0 Ethernet controller: Intel Corporation 82577LM Gigabit Network Connection (rev 06) 02:00.0 Network controller: Intel Corporation Centrino Advanced-N 6200 (rev 35)


但是当我尝试从org-模式通过一个babel源块我没有输出。

But when I try running this from org-mode through a babel source block I get no output.

#+BEGIN_SRC sh
lspci | grep -i net
#+END_SRC

#+RESULTS:

什么给了如何获得与终端相同的输出?

What gives? How can I get the same output I got from the terminal?

推荐答案

您的结果只能处理不当

添加:结果输出替换之后#+ begin_src sh ,作为标头参数(以覆盖默认值),将输出(re)放置您的组织模式缓冲区。 手册中的所有可能的值都被描述。

Add :results output replace after #+begin_src sh, as a header argument (to override default values), to have the output (re)placed in your org-mode buffer. All its possible values are described here in the Manual.

这篇关于在组织模式下捕获带有babel的shell命令的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆