I am looking for a way in Bash to run something within Emacs. For example, if you run emacs, press esc+X then type "life," you get a little simulation of Conway's Game of Life. How could this be done via Bash?

Don't have much so far:


I've read about using ^] and such but doing


does not work (neither does ^[)

Basically, how can I simulate all of these key presses in Bash, with the default Mac Emacs (22.1.1)?

  • I bet there is a command line argument you could pass to emacs to get it to fire up the life simulation. Is that basically what you want - to go directly from bash to the life simulation with no additional key presses?
    – bmike
    Commented Mar 11, 2014 at 23:38
  • @bmike Exactly. Commented Mar 11, 2014 at 23:53

1 Answer 1


Use emacs -f <function>

E.g.: emacs -f life in this case.

GNU Emacs Manual

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .