From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: How to pass shell command result to :post source-block? Date: Sat, 19 Jan 2019 11:04:30 +0800 Message-ID: <87y37hcpq9.fsf@gmail.com> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:39632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkgt5-0004rM-Jh for emacs-orgmode@gnu.org; Fri, 18 Jan 2019 22:01:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkgsw-00040l-7i for emacs-orgmode@gnu.org; Fri, 18 Jan 2019 22:01:31 -0500 Received: from [61.175.244.13] (port=1070 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkgsu-0003nN-UB for emacs-orgmode@gnu.org; Fri, 18 Jan 2019 22:01:25 -0500 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.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode I want to processing the shell ANSI escaping characters correctly or just filter them out for display result correctly in Emacs. Here is my try: #+NAME: ansi-escape-filter #+begin_src emacs-lisp (ansi-color-apply-on-region (point-min) (point-max)) #+end_src #+begin_src sh :dir /sudo:: :post ansi-escape-filter sudo tree /var/spool/postfix/ #+end_src #+RESULTS[<2019-01-19 10:58:39> f6d16244322abbd4fbe01bfaa084ac6bdd66a62c]: : nil The second source block's result is supposed to be result of command =sudo tree /var/spool/postfix/= instead of =nil=. Can someone help me how to do this correctly? -- [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3