For many years whenever I wanted to test the reseults of a sed, find etc command I wrote a one or two line shell script and ran it to see the results, this ending up with an accumulated mess of hundreds of undocumented scripts.
After several months trying to figure out how emacs org babel tangle works I now use something like this construct:
Ctr-c activates the #+begin #+end block. The output is shown under #+RESULTS
this is an *.org file and you need to activete Babel languages in your emacs configuration for this to work.
It took me ages to figure this out, but I'm glad I did.
After several months trying to figure out how emacs org babel tangle works I now use something like this construct:
Code:
* display only lines without comments or having blank lines
#+begin_src sh
sed -E '/^[[:space:]]*($|#)/d' /tmp/dnsmasq.conf > /tmp/dnsmasq.tmp
#+end_src
#+RESULTS:
* some find commands
#+begin_src sh
find /tmp -type d -name 'mc*' -empty -delete
#+end_src
#+RESULTS:
Ctr-c activates the #+begin #+end block. The output is shown under #+RESULTS
this is an *.org file and you need to activete Babel languages in your emacs configuration for this to work.
It took me ages to figure this out, but I'm glad I did.