Function: org-babel--get-shell-file-name

org-babel--get-shell-file-name is a byte-compiled function defined in ob-eval.el.gz.

Signature

(org-babel--get-shell-file-name)

Documentation

Return system shell-file-name, defaulting to /bin/sh.

Unfortunately, executable-find does not support file name handlers. Therefore, we could use it in the local case only.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-eval.el.gz
(defun org-babel--get-shell-file-name ()
  "Return system `shell-file-name', defaulting to /bin/sh.
Unfortunately, `executable-find' does not support file name
handlers.  Therefore, we could use it in the local case only."
  ;; FIXME: Since Emacs 27, `executable-find' accepts optional second
  ;; argument supporting remote hosts.
  (cond ((and (not (file-remote-p default-directory))
	      (executable-find shell-file-name))
	 shell-file-name)
	((file-executable-p
	  (concat (file-remote-p default-directory) shell-file-name))
	 shell-file-name)
	("/bin/sh")))