emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to pass shell command result to :post source-block?


From: stardiviner
Subject: Re: [O] How to pass shell command result to :post source-block?
Date: Sat, 19 Jan 2019 17:20:23 +0800
User-agent: mu4e 1.1.0; emacs 26.1

Ihor Radchenko <address@hidden> writes:

> See the code below:
>
> #+NAME: ansi-escape-filter
> #+begin_src emacs-lisp :var data=""
> (with-temp-buffer
>   (insert data)
>   (ansi-color-apply-on-region (point-min) (point-max))
>   (buffer-string))
> #+end_src
>
> #+RESULTS: ansi-escape-filter
>
> #+begin_src sh :dir /sudo::  :results output :post  
> ansi-escape-filter(data=*this*)
> tree /var/spool/postfix/
> #+end_src
>
> `:results output` is needed to avoid parsing the shell output as a
> table.
> `data=*this*` is needed to pass the output to `ansi-escape-filter`. You
> can also check the example in the org info page for the :post header
> argument.
>
>
> Best,
> Ihor
>

Thanks for your detailed explanation. After your hint, I just checked
out =org-manual.org= about the Post-processing :post example. It's a
good example.

-- 
[ 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
      



reply via email to

[Prev in Thread] Current Thread [Next in Thread]