Run Emacs within Bash 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:

#!/bin/sh
emacs


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

#!/bin/sh
emacs
^]


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)?
Use emacs -f &lt;function&gt;

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

GNU Emacs Manual