minibuffer

How to run some Emacs Lisp code in batch mode #2?

September 24, 2023
◉ tony@tony:~/minibuffer:
$ echo How to run some Emacs Lisp code in batch mode \#2?
How to run some Emacs Lisp code in batch mode #2?
◉ tony@tony:~/minibuffer:
$ emacs --batch --eval '(princ (read-string ""))'
foo
foo◉ tony@tony:~/minibuffer:
$ emacs --batch --load my-elisp.el
bar
bar◉ tony@tony:~/minibuffer:
$ emacs --batch --load my-elisp.el --eval '(princ bar)'
foo
I'm foo◉ tony@tony:~/minibuffer:
$

my-elisp.el:

(setq foo (read-string ""))
(setq bar (concat "I'm " foo))