babel

Using sudo in org-babel

Here's a simple way of using sudo in org-babel: #+NAME: just-open #+BEGIN_SRC shell :tangle no :dir /sudo::~mark/writing exec 2>&1 mkdir -p perf && cd perf /home/mark/.guix-profile/bin/perf stat -e 'block:*' ../open-perf #+END_SRC Use :tangle no to exlude this snippet from being tangled Use :dir /sudo::~mark/writing to activate TRAMP (/sudo) and set the current path that is to be used. Note: paths relative to the document didn't work out for me Use exec 2>& to…

Keep reading