# How can I connect to a REPL and send and read data?

Let us say I have a command to start a REPL. How do I most easily read output and send input? A minimal example with shell, sending ls and reading the output would be appreciated.

The shell should preferably not be opened in a buffer, but run in the background, if that isn't very hard.

What you are looking for is called comint-mode - the system which underlies most (all?) emacs interaction modes (lisp, scheme, shell, python, &c).