2

If do M-x org-babel-execute-src-block over the code block below, I get "evaluate this bash code block on your system", and then "no org-babel-execute function for bash". Changing bash to shell or sh, same. I found support for powershell but not the ones listed. The comment in this post mentions org-babel-do-load-languages, but I don't have it. So what then, could I do? Also, why isn't there a key binding for the first command listed?

#+begin_src bash :results output
echo "Hello world!"
#+end_src

enter image description here enter image description here

  • `M-x load-library RET ob-shell RET` should allow you to execute the src block. Assuming that works, then add `(eval-after-load 'org (add-to-list 'org-babel-load-languages '(shell . t)))` to your init file to make it permanent - or customize `org-babel-load-languages` through the customize interface. – NickD Jan 18 '23 at 02:24
  • 1
    There should be: it is defined in `org.el` so do `(require 'org)` and then try `C-h v org-babel-load-languages` again. With the `eval-after-load` form in your init file, you don't have to worry about when `org` is loaded: when it is, `org-babel-load-languages` will be defined and the form will reset it to add the `ob-shell` backend. – NickD Jan 18 '23 at 03:26

1 Answers1

2

Based on the comments, do M-x customize-variable RET org-babel-load-languages, and proceed as intuitable from the picture. Then go back to the original buffer and reload the emacs init file. Then do M-x org-babel-execute-src-block (or C-c C-c) over the code block.

#+begin_src shell :results output
echo "Hello world!"
#+end_src

Results in this addition to the buffer:

#+RESULTS:
: Hello world!

enter image description here