How do I execute a .scm script (outside of the REPL) with MIT-Scheme?

Rusty picture Rusty · May 24, 2009 · Viewed 17.7k times · Source

I want to type something like 'scheme file.scm' and have it interpret the file, and then take me back to my shell, rather than loading it in the REPL.

edit: I tried scheme < test.scm and it still uses the REPL, the only difference is that scheme exits when the stream ends.

Answer

Alex Martelli picture Alex Martelli · May 24, 2009

scheme < file.scm should work (as long as you don't specify --interactive and stdin is not a terminal, scheme works non-interactively).