Capturing diff output with org-babel

I am trying to capture diff output using org-babel, but for some reason it is not working. For files

one

 abc 

2

 acb 

diff 1 2 , called from the command line, returns

 1c1 < abc --- > acb 

But with org-babel nothing:

 #+begin_src sh diff 1 2 #+end_src #+RESULTS: 

The microbuffer reads "Code block does not produce output." The org-babel error exit window is empty. Other commands, such as ls , show the result as expected. I am not familiar with org-babel.

I tried using :results output verbatim , no change. I also tried using :results output replace , as suggested here . Did not help.

  • Emacs Version - 24.4.1 (on Debian jessie)
  • Version in Org mode - 8.2.10
+7
emacs sh org-mode org-babel
source share
1 answer

I could reproduce your problem (on OSX).

It is strange that executing the babel block will open the Org-Babel error output buffer, as if something was happening with STDERR.

If you add any other result after diff, the results will be displayed OK. For example,

 #+begin_src sh :results output diff 1 2 echo #+end_src 

If you force diff results to stdout, the results will also be displayed:

 #+begin_src sh :results output diff 1 2 | cat #+end_src 
+6
source share

All Articles