Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capture output from a shell command with babel in org-mode

I want to know about my networking hardware.

lspci | grep -i net

From the terminal, this command gives the following output:

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)

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?

like image 793
wdkrnls Avatar asked Oct 07 '12 18:10

wdkrnls


1 Answers

You do get results, only not handled properly (most likely temporarily displayed in the minibuffer).

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.

like image 56
Nikana Reklawyks Avatar answered Nov 07 '22 07:11

Nikana Reklawyks