From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Nikishkin Subject: How do I diff the outputs of two blocks in org-babel? Date: Thu, 5 Mar 2020 13:07:43 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:47207) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9ijm-0001Bh-3N for emacs-orgmode@gnu.org; Thu, 05 Mar 2020 00:07:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9ijk-0007Oe-Uo for emacs-orgmode@gnu.org; Thu, 05 Mar 2020 00:07:57 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:37035) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j9ijk-0007Le-Oo for emacs-orgmode@gnu.org; Thu, 05 Mar 2020 00:07:56 -0500 Received: by mail-ed1-x532.google.com with SMTP id t7so5196573edr.4 for ; Wed, 04 Mar 2020 21:07:56 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Support I have two blocks: #+name: block1 #+begin_src shell cat <<'ADDTEXT4' #!/bin/bash echo "This script creates a new file" var1=10 var3=50 ((result=$var1*$var2)) echo "The result = $result" ADDTEXT4 #+end_src #+name: block2 #+begin_src shell cat <<'ADDTEXT4' #!/bin/bash echo "This script creates a new file" var1=10 var2=50 ((result=$var1*$var2)) echo "The result = $result" ADDTEXT4 #+end_src The first one has a bug in it. At the moment I am diffing them like this: #+begin_src shell :results output code :wrap src patch output1=$( cat <> EOF ) output2=$( cat <> EOF ) diff -s -u <(echo "$output1") <(echo "$output2") #+end_src But this looks a bit too complicated. Any better solution? -- Yours sincerely, Vladimir Nikishkin