The only known way to run eshell script from shell (outside emacs). This starts emacs UI. Add --batch to run without UI. emacs --debug-init -q --eval “(progn (require 'em-script) (let ((eshell-rc-script \“/tmp/wtf.esh\“)) (eshell)))“
Use shebang + exec emacs --script to run emacs code as a shell script but also as emacs code, for example load-file #! /bin/sh “:“; exec emacs --no-site-file --script “$0“ -- “$@“ # -*-emacs-lisp-*- (print (+ 2 2))
Run elisp code as script - summary